@@ -58,7 +58,7 @@ class RtosTimer : private TimerEvent {
58
58
// Ensure SysTick has the correct priority as it is still used
59
59
// to trigger software interrupts on each tick. The period does
60
60
// not matter since it will never start counting.
61
- SysTick_Setup ( 16 );
61
+ OS_Tick_Setup (osRtxConfig. tick_freq , OS_TICK_HANDLER );
62
62
#endif
63
63
};
64
64
@@ -138,41 +138,57 @@ class RtosTimer : private TimerEvent {
138
138
static RtosTimer *os_timer;
139
139
static uint64_t os_timer_data[sizeof (RtosTimer) / 8 ];
140
140
141
- // / Setup System Timer.
142
- int32_t osRtxSysTimerSetup (void )
141
+ // / Enable System Timer.
142
+ int32_t OS_Tick_Enable (void )
143
143
{
144
144
// Do not use SingletonPtr since this relies on the RTOS
145
145
if (NULL == os_timer) {
146
146
os_timer = new (os_timer_data) RtosTimer ();
147
147
}
148
- return -1 ;
149
- }
150
148
151
- // / Enable System Timer.
152
- void osRtxSysTimerEnable (void )
153
- {
154
149
// set to fire interrupt on next tick
155
150
os_timer->schedule_tick ();
151
+
152
+ return 0 ;
156
153
}
157
154
158
155
// / Disable System Timer.
159
- void osRtxSysTimerDisable (void )
156
+ int32_t OS_Tick_Disable (void )
160
157
{
161
158
os_timer->cancel_tick ();
159
+
160
+ return 0 ;
162
161
}
163
162
164
163
// / Acknowledge System Timer IRQ.
165
- void osRtxSysTimerAckIRQ (void )
164
+ int32_t OS_Tick_AcknowledgeIRQ (void )
166
165
{
167
166
os_timer->schedule_tick ();
167
+
168
+ return 0 ;
168
169
}
169
170
170
171
// / Get System Timer count.
171
- uint32_t osRtxSysTimerGetCount (void )
172
+ uint32_t OS_Tick_GetCount (void )
172
173
{
173
174
return os_timer->get_time () & 0xFFFFFFFF ;
174
175
}
175
176
177
+ // Get OS Tick IRQ number.
178
+ int32_t OS_Tick_GetIRQn (void ) {
179
+ return -1 ;
180
+ }
181
+
182
+ // Get OS Tick overflow status.
183
+ uint32_t OS_Tick_GetOverflow (void ) {
184
+ return 0 ;
185
+ }
186
+
187
+ // Get OS Tick interval.
188
+ uint32_t OS_Tick_GetInterval (void ) {
189
+ return 1000 ;
190
+ }
191
+
176
192
static void default_idle_hook (void )
177
193
{
178
194
uint32_t elapsed_ticks = 0 ;
0 commit comments