Skip to content

Commit

Permalink
move radio.irqprocess to interrupt
Browse files Browse the repository at this point in the history
  • Loading branch information
Heltec-Aaron-Lee committed Feb 3, 2021
1 parent 7d2fc7c commit 34b0ab7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
7 changes: 3 additions & 4 deletions cores/asr650x/device/asr6501_lrwan/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,12 +1120,11 @@ void RadioOnCadTimeoutIrq( void )
}

extern void enableUart(void);
extern uint8_t dio1_ClearInterrupt(void);
void RadioOnDioIrq( void )
{
IrqFired = true;
//dio1_ClearInterrupt();
//RadioIrqProcess();
pinMode(P4_1,INPUT);
IrqFired = true;
RadioIrqProcess();
}

void RadioIrqProcess( void )
Expand Down
8 changes: 8 additions & 0 deletions cores/asr650x/loramac/mac/LoRaMac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,14 @@ static void OnRadioTxTimeout( void )
#endif
DIO_PRINTF("Event : Tx Timeout\r\n");

Radio.Init( &RadioEvents );
// Random seed initialization
srand1( Radio.Random( ) );

PublicNetwork = true;
Radio.SetPublicNetwork(true);
Radio.Sleep( );

if( LoRaMacDeviceClass != CLASS_C )
{
Radio.Sleep( );
Expand Down
6 changes: 4 additions & 2 deletions cores/asr650x/projects/PSoC4/CyLFClk.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "CyLFClk.h"
#include "CyLib.h"

#include "ASR_Arduino.h"


#if (CY_IP_WCO && CY_IP_SRSSV2)
Expand Down Expand Up @@ -2863,7 +2863,6 @@ cystatus CySysClkIloRestoreFactoryTrim(void)
}
}


/*******************************************************************************
* Function Name: CySysTimerIsr
****************************************************************************//**
Expand Down Expand Up @@ -2891,6 +2890,7 @@ cystatus CySysClkIloRestoreFactoryTrim(void)
disableTimerServicedIsr &= ~CY_SYS_TIMER0_INT;
if(cySysTimerCallback[CY_SYS_TIMER0] != (void *) 0)
{
pinMode(P4_1,INPUT);
(void)(cySysTimerCallback[CY_SYS_TIMER0])();
}
}
Expand All @@ -2905,6 +2905,7 @@ cystatus CySysClkIloRestoreFactoryTrim(void)
disableTimerServicedIsr &= ~CY_SYS_TIMER1_INT;
if(cySysTimerCallback[CY_SYS_TIMER1] != (void *) 0)
{
pinMode(P4_1,INPUT);
(void)(cySysTimerCallback[CY_SYS_TIMER1])();
}
}
Expand All @@ -2917,6 +2918,7 @@ cystatus CySysClkIloRestoreFactoryTrim(void)
{
if(cySysTimerCallback[CY_SYS_TIMER2] != (void *) 0)
{
pinMode(P4_1,INPUT);
(void)(cySysTimerCallback[CY_SYS_TIMER2])();
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/LoRa/src/LoRaWan_APP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ void LoRaWanClass::sleep()
#endif

// Process Radio IRQ
Radio.IrqProcess( );
//Radio.IrqProcess( );
}
void LoRaWanClass::setDataRateForNoADR(int8_t dataRate)
{
Expand Down

0 comments on commit 34b0ab7

Please sign in to comment.