@@ -639,6 +639,12 @@ static void rxfsk (bool rxcontinuous) {
639
639
// enable IRQs in HAL
640
640
hal_irqmask_set (HAL_IRQMASK_DIO1 );
641
641
642
+ ostime_t now = os_getTime ();
643
+ if (!rxcontinuous && LMIC .rxtime - now < 0 ) {
644
+ debug_printf ("WARNING: rxtime is %d ticks in the past! (ramp-up time %d ms / %d ticks)\r\n" ,
645
+ now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
646
+ }
647
+
642
648
// now receive (lock interrupts only for final fine tuned rx timing...)
643
649
hal_disableIRQs ();
644
650
if (rxcontinuous ) { // continous rx
@@ -650,11 +656,6 @@ static void rxfsk (bool rxcontinuous) {
650
656
} else { // single rx
651
657
BACKTRACE ();
652
658
// busy wait until exact rx time
653
- ostime_t now = os_getTime ();
654
- if (LMIC .rxtime - now < 0 ) {
655
- debug_printf ("WARNING: rxtime is %d ticks in the past! (ramp-up time %d ms / %d ticks)\r\n" ,
656
- now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
657
- }
658
659
hal_waitUntil (LMIC .rxtime );
659
660
// enable antenna switch for RX (and account power consumption)
660
661
hal_pin_rxtx (0 );
@@ -688,6 +689,14 @@ static void rxlora (bool rxcontinuous) {
688
689
// enable IRQs in HAL
689
690
hal_irqmask_set (HAL_IRQMASK_DIO1 );
690
691
692
+ ostime_t now = os_getTime ();
693
+ if (!rxcontinuous && LMIC .rxtime - now < 0 ) {
694
+ // Print before disabling IRQs, to work around deadlock on some
695
+ // Arduino cores that doe not really support printing without IRQs
696
+ debug_printf ("WARNING: rxtime is %d ticks in the past! (ramp-up time %d ms / %d ticks)\r\n" ,
697
+ now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
698
+ }
699
+
691
700
// now receive (lock interrupts only for final fine tuned rx timing...)
692
701
hal_disableIRQs ();
693
702
if (rxcontinuous ) { // continous rx
@@ -699,11 +708,6 @@ static void rxlora (bool rxcontinuous) {
699
708
} else { // single rx
700
709
BACKTRACE ();
701
710
// busy wait until exact rx time
702
- ostime_t now = os_getTime ();
703
- if (LMIC .rxtime - now < 0 ) {
704
- debug_printf ("WARNING: rxtime is %d ticks in the past! (ramp-up time %d ms / %d ticks)\r\n" ,
705
- now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
706
- }
707
711
hal_waitUntil (LMIC .rxtime );
708
712
// enable antenna switch for RX (and account power consumption)
709
713
hal_pin_rxtx (0 );
0 commit comments