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
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