STM32 KEIL microcontroller reports error: #31: expression must have integral type"

This is actually caused by data inconsistency and calculation.
As long as we force the data to be the same, the error
will be solved. Add (uint16_t) or other data types to the data.
Example

	num=(uint16_t)240000/(uint16_t)TIM_KHZ/(uint16_t)10;

Guess you like

Origin blog.csdn.net/m0_46179894/article/details/108836404