This repository was archived by the owner on Sep 16, 2024. It is now read-only.
File tree 4 files changed +14
-12
lines changed
4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ IRAM_ATTR static void HAL_TimerCallback (void* arg) {
58
58
HAL_tick_user_cb ();
59
59
}
60
60
61
- TIMERG0 .int_clr_timers .t1 = 1 ;
62
- TIMERG0 .hw_timer [1 ].update = 1 ;
63
- TIMERG0 .hw_timer [1 ].config .alarm_en = 1 ;
61
+ TIMERG0 .int_clr_timers .t1 = 1 ;
62
+ TIMERG0 .hw_timer [1 ].update = 1 ;
63
+ TIMERG0 .hw_timer [1 ].config .alarm_en = 1 ;
64
64
65
65
}
66
66
Original file line number Diff line number Diff line change @@ -56,12 +56,17 @@ static TimerTime_t TimerTickCounterContext = 0;
56
56
* Value trigging the IRQ
57
57
*/
58
58
DRAM_ATTR volatile TimerTime_t TimeoutCntValue = 0 ;
59
-
59
+ extern TaskHandle_t xLoRaTimerTaskHndl ;
60
60
61
61
static IRAM_ATTR void TimerCallback (void ) {
62
+ BaseType_t xHigherPriorityTaskWoken = pdFALSE ;
63
+
62
64
TimerTickCounter ++ ;
63
65
if (TimeoutCntValue > 0 && TimerTickCounter == TimeoutCntValue ) {
64
66
TimerIrqHandler ();
67
+ // Notify the thread so it will wake up when the ISR is complete
68
+ vTaskNotifyGiveFromISR (xLoRaTimerTaskHndl , & xHigherPriorityTaskWoken );
69
+ portYIELD_FROM_ISR ();
65
70
}
66
71
}
67
72
Original file line number Diff line number Diff line change @@ -1052,10 +1052,12 @@ static void TASK_LoRa_Timer (void *pvParameters) {
1052
1052
if (thread_notification ) {
1053
1053
1054
1054
modlora_timerCallback cb ;
1055
- xQueueReceive (xCbQueue , & cb , 0 );
1056
- if (cb != NULL )
1055
+ while (pdTRUE == xQueueReceive (xCbQueue , & cb , 0 ))
1057
1056
{
1058
- cb ();
1057
+ if (cb != NULL )
1058
+ {
1059
+ cb ();
1060
+ }
1059
1061
}
1060
1062
}
1061
1063
}
Original file line number Diff line number Diff line change @@ -229,11 +229,6 @@ IRAM_ATTR void TimerIrqHandler( void )
229
229
if ( elapsedTimer -> Callback != NULL )
230
230
{
231
231
modlora_set_timer_callback (elapsedTimer -> Callback );
232
-
233
- BaseType_t xHigherPriorityTaskWoken = pdFALSE ;
234
- // Notify the thread so it will wake up when the ISR is complete
235
- vTaskNotifyGiveFromISR (xLoRaTimerTaskHndl , & xHigherPriorityTaskWoken );
236
- portYIELD_FROM_ISR ();
237
232
}
238
233
}
239
234
You can’t perform that action at this time.
0 commit comments