keatis / dwt_delay

Microseconds delay lib for STM32 (or whatever ARM) based on DWT
MIT License
80 stars 28 forks source link

use any mcu, no need to change code. #6

Closed ghosoft closed 9 months ago

mickjc750 commented 1 year ago

What and where is main.h? Are you intending the user to configure dwt_delay.c by putting the necessary includes & defines in the header file for their main.c? (or whichever file holds main(), they may not have a main.c/.h).

keatis commented 9 months ago

Actually, including main.h is not a solution for different reasons. Most probable one is that proper header file might be included in main.c, and thus including main.h will give nothing. Or it can be included in any other c-file in the project, if project owner wants to maintain cleanest and shortest main()... Anyway, DWT_Delay needs to import MCU's peripheral definitions and MCU clock rate. Problem is that include path is quite varying for different MCU vendors and hardware libs.