Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer setup for DMA mode #6

Open
kmacriver opened this issue Jul 28, 2023 · 2 comments
Open

Timer setup for DMA mode #6

kmacriver opened this issue Jul 28, 2023 · 2 comments

Comments

@kmacriver
Copy link

Hi Maudeve,

When I enable the timer it says its undeclared in z_display_ILI94XXX.h during compiling.

../Core/Inc/z_displ_ILI9XXX.h:124:41: error: 'htim14' undeclared (first use in this function); did you mean 'htim'?
124 | #define TGFX_T htim14
| ^~~~~~
../Core/Src/z_displ_ILI9XXX.c:1189:20: note: in expansion of macro 'TGFX_T'
1189 | if (htim==&TGFX_T){
| ^~~~~~
../Core/Inc/z_displ_ILI9XXX.h:124:41: note: each undeclared identifier is reported only once for each function it appears in
124 | #define TGFX_T htim14
| ^~~~~~
../Core/Src/z_displ_ILI9XXX.c:1189:20: note: in expansion of macro 'TGFX_T'
1189 | if (htim==&TGFX_T){

The main.cpp has the declaration
TIM_HandleTypeDef htim14;

//--------------Solution-------------------

You need to extern define the timer inside z_displ_ILI9XXX.c

Add the lines at the top under the spi declaration

#ifdef TGFX_TIMER
extern TIM_HandleTypeDef TGFX_T;
#endif

// Also change the Lines in z_displ_ILI9XXX.h to (sub in your timer port)

#ifdef DISPLAY_SPI_DMA_MODE
#define TGFX_TIMER TIM14
#endif
#define TGFX_T htim14

@maudeve-it
Copy link
Owner

Hi kmacriver,
that sound strange because I never got the error you mention.
After some search I found the reason why!

On top of "z_displ_ILI94XX.c", you should see:

#ifdef DISPLAY_DIMMING_MODE
extern TIM_HandleTypeDef BKLIT_T;
extern TIM_HandleTypeDef TGFX_T;
#endif							

That's a mistake: the extern declaration of TGFX_T is submitted to the dimming backlight.
It seems I didn't tested last updates with no "dimming".
And I suppose you didn't use it.

declarations have be changed to:

#ifdef DISPLAY_DIMMING_MODE
extern TIM_HandleTypeDef BKLIT_T;
#endif							
extern TIM_HandleTypeDef TGFX_T;

Fixed.
Thank you!

@CE3kmacriver
Copy link

Hi Maudeve,

I am looking at the differences between in ILI9488 and the ILI9486. Both are the same resolution (320X480). The ili9488 does only RGB666 and the ILI9486 does both RGB565 and RGB666. This might explain what you are seeing with the V2/V1 issue, one of your displays may be a ILI9486 which are relatively new. There is a command: Read display identification information (04h) that might help explain what you are seeing. I don't have a ILI9486 display so unfortunately I can't do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants