@@ -656,6 +656,12 @@ static void rxfsk (bool rxcontinuous) {
656
656
// enable IRQs in HAL
657
657
hal_irqmask_set (HAL_IRQMASK_DIO1 );
658
658
659
+ ostime_t now = os_getTime ();
660
+ if (!rxcontinuous && LMIC .rxtime - now < 0 ) {
661
+ debug_printf ("WARNING: rxtime is %ld ticks in the past! (ramp-up time %ld ms / %ld ticks)\r\n" ,
662
+ now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
663
+ }
664
+
659
665
// now receive (lock interrupts only for final fine tuned rx timing...)
660
666
hal_disableIRQs ();
661
667
if (rxcontinuous ) { // continous rx
@@ -667,11 +673,6 @@ static void rxfsk (bool rxcontinuous) {
667
673
} else { // single rx
668
674
BACKTRACE ();
669
675
// busy wait until exact rx time
670
- ostime_t now = os_getTime ();
671
- if (LMIC .rxtime - now < 0 ) {
672
- debug_printf ("WARNING: rxtime is %ld ticks in the past! (ramp-up time %ld ms / %ld ticks)\r\n" ,
673
- now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
674
- }
675
676
hal_waitUntil (LMIC .rxtime );
676
677
// enable antenna switch for RX (and account power consumption)
677
678
hal_pin_rxtx (0 );
@@ -705,6 +706,14 @@ static void rxlora (bool rxcontinuous) {
705
706
// enable IRQs in HAL
706
707
hal_irqmask_set (HAL_IRQMASK_DIO1 );
707
708
709
+ ostime_t now = os_getTime ();
710
+ if (!rxcontinuous && LMIC .rxtime - now < 0 ) {
711
+ // Print before disabling IRQs, to work around deadlock on some
712
+ // Arduino cores that doe not really support printing without IRQs
713
+ debug_printf ("WARNING: rxtime is %ld ticks in the past! (ramp-up time %ld ms / %ld ticks)\r\n" ,
714
+ now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
715
+ }
716
+
708
717
// now receive (lock interrupts only for final fine tuned rx timing...)
709
718
hal_disableIRQs ();
710
719
if (rxcontinuous ) { // continous rx
@@ -716,11 +725,6 @@ static void rxlora (bool rxcontinuous) {
716
725
} else { // single rx
717
726
BACKTRACE ();
718
727
// busy wait until exact rx time
719
- ostime_t now = os_getTime ();
720
- if (LMIC .rxtime - now < 0 ) {
721
- debug_printf ("WARNING: rxtime is %ld ticks in the past! (ramp-up time %ld ms / %ld ticks)\r\n" ,
722
- now - LMIC .rxtime , osticks2ms (now - t0 ), now - t0 );
723
- }
724
728
hal_waitUntil (LMIC .rxtime );
725
729
// enable antenna switch for RX (and account power consumption)
726
730
hal_pin_rxtx (0 );
0 commit comments