@@ -41,9 +41,9 @@ const ticker_interface_t* intf;
41
41
42
42
static volatile unsigned int overflowCounter;
43
43
44
- unsigned int ticks_to_us (unsigned int ticks, unsigned int freq)
44
+ uint32_t ticks_to_us (uint32_t ticks, uint32_t freq)
45
45
{
46
- return (unsigned int )((unsigned long long )ticks * US_PER_S / freq);
46
+ return (uint32_t )((uint64_t )ticks * US_PER_S / freq);
47
47
}
48
48
49
49
void ticker_event_handler_stub (const ticker_data_t * const ticker)
@@ -65,9 +65,9 @@ void ticker_frequency_test()
65
65
char _key[11 ] = { };
66
66
char _value[128 ] = { };
67
67
int expected_key = 1 ;
68
- const unsigned int ticker_freq = intf->get_info ()->frequency ;
69
- const unsigned int ticker_bits = intf->get_info ()->bits ;
70
- const unsigned int ticker_max = (1 << ticker_bits) - 1 ;
68
+ const uint32_t ticker_freq = intf->get_info ()->frequency ;
69
+ const uint32_t ticker_bits = intf->get_info ()->bits ;
70
+ const uint32_t ticker_max = (1 << ticker_bits) - 1 ;
71
71
72
72
overflowCounter = 0 ;
73
73
@@ -84,15 +84,15 @@ void ticker_frequency_test()
84
84
expected_key = strcmp (_key, " base_time" );
85
85
} while (expected_key);
86
86
87
- const unsigned int begin_ticks = intf->read ();
87
+ const uint32_t begin_ticks = intf->read ();
88
88
89
89
/* Assume that there was no overflow at this point - we are just after init. */
90
90
greentea_send_kv (_key, ticks_to_us (begin_ticks, ticker_freq));
91
91
92
92
/* Wait for 2nd signal from host. */
93
93
greentea_parse_kv (_key, _value, sizeof (_key), sizeof (_value));
94
94
95
- const unsigned int end_ticks = intf->read ();
95
+ const uint32_t end_ticks = intf->read ();
96
96
97
97
greentea_send_kv (_key, ticks_to_us (end_ticks + overflowCounter * ticker_max, ticker_freq));
98
98
0 commit comments