@@ -71,9 +71,9 @@ FuriEventLoop* furi_event_loop_alloc(void) {
71
71
PendingQueue_init (instance -> pending_queue );
72
72
73
73
// Clear notification state and value
74
- xTaskNotifyStateClearIndexed ( instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX ) ;
75
- ulTaskNotifyValueClearIndexed (
76
- instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , 0xFFFFFFFF );
74
+ TaskHandle_t task = ( TaskHandle_t ) instance -> thread_id ;
75
+ xTaskNotifyStateClearIndexed ( task , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX );
76
+ ulTaskNotifyValueClearIndexed ( task , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , 0xFFFFFFFF );
77
77
78
78
return instance ;
79
79
}
@@ -178,18 +178,19 @@ static void furi_event_loop_process_waiting_list(FuriEventLoop* instance) {
178
178
static void furi_event_loop_restore_flags (FuriEventLoop * instance , uint32_t flags ) {
179
179
if (flags ) {
180
180
xTaskNotifyIndexed (
181
- instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , flags , eSetBits );
181
+ ( TaskHandle_t ) instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , flags , eSetBits );
182
182
}
183
183
}
184
184
185
185
void furi_event_loop_run (FuriEventLoop * instance ) {
186
186
furi_check (instance );
187
187
furi_check (instance -> thread_id == furi_thread_get_current_id ());
188
188
189
+ FuriThread * thread = furi_thread_get_current ();
190
+
189
191
// Set the default signal callback if none was previously set
190
- if (furi_thread_get_signal_callback (instance -> thread_id ) == NULL ) {
191
- furi_thread_set_signal_callback (
192
- instance -> thread_id , furi_event_loop_signal_callback , instance );
192
+ if (furi_thread_get_signal_callback (thread ) == NULL ) {
193
+ furi_thread_set_signal_callback (thread , furi_event_loop_signal_callback , instance );
193
194
}
194
195
195
196
furi_event_loop_init_tick (instance );
@@ -233,16 +234,19 @@ void furi_event_loop_run(FuriEventLoop* instance) {
233
234
}
234
235
235
236
// Disable the default signal callback
236
- if (furi_thread_get_signal_callback (instance -> thread_id ) == furi_event_loop_signal_callback ) {
237
- furi_thread_set_signal_callback (instance -> thread_id , NULL , NULL );
237
+ if (furi_thread_get_signal_callback (thread ) == furi_event_loop_signal_callback ) {
238
+ furi_thread_set_signal_callback (thread , NULL , NULL );
238
239
}
239
240
}
240
241
241
242
void furi_event_loop_stop (FuriEventLoop * instance ) {
242
243
furi_check (instance );
243
244
244
245
xTaskNotifyIndexed (
245
- instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , FuriEventLoopFlagStop , eSetBits );
246
+ (TaskHandle_t )instance -> thread_id ,
247
+ FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX ,
248
+ FuriEventLoopFlagStop ,
249
+ eSetBits );
246
250
}
247
251
248
252
/*
@@ -265,7 +269,10 @@ void furi_event_loop_pend_callback(
265
269
PendingQueue_push_front (instance -> pending_queue , item );
266
270
267
271
xTaskNotifyIndexed (
268
- instance -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , FuriEventLoopFlagPending , eSetBits );
272
+ (TaskHandle_t )instance -> thread_id ,
273
+ FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX ,
274
+ FuriEventLoopFlagPending ,
275
+ eSetBits );
269
276
}
270
277
271
278
/*
@@ -473,7 +480,10 @@ static void furi_event_loop_item_notify(FuriEventLoopItem* instance) {
473
480
FURI_CRITICAL_EXIT ();
474
481
475
482
xTaskNotifyIndexed (
476
- owner -> thread_id , FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX , FuriEventLoopFlagEvent , eSetBits );
483
+ (TaskHandle_t )owner -> thread_id ,
484
+ FURI_EVENT_LOOP_FLAG_NOTIFY_INDEX ,
485
+ FuriEventLoopFlagEvent ,
486
+ eSetBits );
477
487
}
478
488
479
489
static bool furi_event_loop_item_is_waiting (FuriEventLoopItem * instance ) {
0 commit comments