File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,15 @@ extern uint32_t SystemCoreClock;
45
45
* 1000 ms delay: tolerance = 20500 us
46
46
*
47
47
* */
48
- #define DELTA_US (delay_ms ) (500 + (delay_ms) * US_PER_MSEC / 50 )
49
- #define DELTA_MS (delay_ms ) (1 + ((delay_ms) * US_PER_MSEC / 50 / US_PER_MSEC))
50
- #define DELTA_S (delay_ms ) (0 .000500f + (((float )(delay_ms)) / MSEC_PER_SEC / 50 ))
48
+ #ifdef NO_SYSTICK
49
+ #define TOLERANCE 5
50
+ #else
51
+ #define TOLERANCE 2
52
+ #endif
53
+
54
+ #define DELTA_US (delay_ms ) (500 + (delay_ms) * US_PER_MSEC * TOLERANCE / 100 )
55
+ #define DELTA_MS (delay_ms ) (1 + (delay_ms) * TOLERANCE / 100 )
56
+ #define DELTA_S (delay_ms ) (0 .000500f + ((float )(delay_ms)) * ((float )(TOLERANCE) / 100 .f) / MSEC_PER_SEC)
51
57
52
58
#define TICKER_FREQ_1MHZ 1000000
53
59
#define TICKER_BITS 32
You can’t perform that action at this time.
0 commit comments