File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ extern "C" {
5454
5555#define OS_CPUTIME_FREQ_1MHZ
5656
57+ #elif MYNEWT_VAL (OS_CPUTIME_FREQ ) == 32000
58+
59+ #define OS_CPUTIME_FREQ_32000HZ
60+
5761#elif MYNEWT_VAL (OS_CPUTIME_FREQ ) == 256 || \
5862 MYNEWT_VAL (OS_CPUTIME_FREQ ) == 512 || \
5963 MYNEWT_VAL (OS_CPUTIME_FREQ ) == 1024 || \
@@ -171,6 +175,20 @@ os_cputime_ticks_to_usecs(uint32_t ticks)
171175 return ticks * (1000000 / MYNEWT_VAL (OS_CPUTIME_FREQ ));
172176}
173177
178+ #elif defined(OS_CPUTIME_FREQ_32000HZ )
179+
180+ static inline uint32_t
181+ os_cputime_usecs_to_ticks (uint32_t usecs )
182+ {
183+ return usecs * 4 / 125 ;
184+ }
185+
186+ static inline uint32_t
187+ os_cputime_ticks_to_usecs (uint32_t ticks )
188+ {
189+ return ticks * 125 / 4 ;
190+ }
191+
174192#else
175193
176194/**
You can’t perform that action at this time.
0 commit comments