File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -46,23 +46,14 @@ extern uint32_t SystemCoreClock;
46
46
* 1000 ms delay: tolerance = 50500 us
47
47
*
48
48
* */
49
- #define DELTA_US (delay_ms ) (500 + delay_ms * US_PER_MSEC / 20 )
50
- #define DELTA_MS (delay_ms ) (1 + (delay_ms * US_PER_MSEC / 20 / US_PER_MSEC))
51
- #define DELTA_S (delay_ms ) (0 .000500f + (((float )delay_ms) / MSEC_PER_SEC / 20 ))
52
49
53
50
#define US_PER_SEC 1000000
54
51
#define US_PER_MSEC 1000
55
- #define TOLERANCE_FACTOR 80000 .0f
56
- #define US_FACTOR 1000000 .0f
57
- #define CLOCK_MAX 130000000
52
+ #define MSEC_PER_SEC 1000
58
53
59
- static const int delta_sys_clk_us = (SystemCoreClock < CLOCK_MAX? ((int ) (TOLERANCE_FACTOR / (float ) SystemCoreClock * US_FACTOR)):((int ) (TOLERANCE_FACTOR / (float ) CLOCK_MAX * US_FACTOR)));
60
-
61
- /* When test performs time measurement using Timer in sequence, then measurement error accumulates
62
- * in the successive attempts. */
63
- #define DELTA_US (i ) (delta_sys_clk_us * i)
64
- #define DELTA_S (i ) ((float )delta_sys_clk_us * i / US_PER_SEC)
65
- #define DELTA_MS (i ) (1 + ( (i * delta_sys_clk_us) / US_PER_MSEC))
54
+ #define DELTA_US (delay_ms ) (500 + (delay_ms) * US_PER_MSEC / 20 )
55
+ #define DELTA_MS (delay_ms ) (1 + ((delay_ms) * US_PER_MSEC / 20 / US_PER_MSEC))
56
+ #define DELTA_S (delay_ms ) (0 .000500f + (((float )(delay_ms)) / MSEC_PER_SEC / 20 ))
66
57
67
58
/* This test verifies if low power timer is stopped after
68
59
* creation.
Original file line number Diff line number Diff line change @@ -45,9 +45,9 @@ 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
+ #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 ))
51
51
52
52
#define TICKER_FREQ_1MHZ 1000000
53
53
#define TICKER_BITS 32
You can’t perform that action at this time.
0 commit comments