Question
How to enable a timer using cube hal?
Posted on November 26, 2015 at 14:06
Working with:
- Stm32F401C-Disco
- STM32Cube_FW_F4_V1.9.0
- CubeMX 4.11.0
- SW4STM32
__TIM3_CLK_ENABLE();
well, it works, but 3 things bother me here (yep, most might cosmetics, but because of my company guidelines the code must be as clean as possible):- The macro is located in stm32_hal_legacy.h. As I'm working on a fresh new project, I don't want to use legacy stuff.
- The double underscore prefix of the macro sounds like private stuff rather than api for application code, isn't it?
- Using SW4STM32 with -Wall -Wextra in C++ source give warnings: ''conversion to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'''
#define UNUSED(x) ((void)(x))
The problem became solved when I just remove two brackets like:#define UNUSED(x) ((void)x)
It seems that this is more portable than the current macro. So could you please:- State out how to enable the timer using cube hal (without legacy macros and hopefully without underscore prefixing).
- Change the `#define UNUSED` in stm32f4xx_hal_def.h
