local copy of sx1276 library
Dependents: SX1276_GPS demo_SX1276_standalone
Fork of SX1276Lib by
Diff: sx1276/sx1276.cpp
- Revision:
- 17:20ce6dab2237
- Parent:
- 16:29f09ac61412
--- a/sx1276/sx1276.cpp Tue Jun 16 11:52:30 2015 +0000 +++ b/sx1276/sx1276.cpp Thu Sep 03 14:33:00 2015 +0000 @@ -182,9 +182,10 @@ RFLR_IRQFLAGS_PAYLOADCRCERROR | RFLR_IRQFLAGS_VALIDHEADER | RFLR_IRQFLAGS_TXDONE | - RFLR_IRQFLAGS_CADDONE | - RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL | - RFLR_IRQFLAGS_CADDETECTED ); + //RFLR_IRQFLAGS_CADDONE | + RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL// | + //RFLR_IRQFLAGS_CADDETECTED + ); // Set radio in continuous reception SetOpMode( RF_OPMODE_RECEIVER ); @@ -781,10 +782,11 @@ //RFLR_IRQFLAGS_RXDONE | //RFLR_IRQFLAGS_PAYLOADCRCERROR | RFLR_IRQFLAGS_VALIDHEADER | - RFLR_IRQFLAGS_TXDONE | - RFLR_IRQFLAGS_CADDONE | + RFLR_IRQFLAGS_TXDONE // | + //x RFLR_IRQFLAGS_CADDONE | //RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL | - RFLR_IRQFLAGS_CADDETECTED ); + //x RFLR_IRQFLAGS_CADDETECTED + ); // DIO0=RxDone, DIO2=FhssChangeChannel Write( REG_DIOMAPPING1, ( Read( REG_DIOMAPPING1 ) & RFLR_DIOMAPPING1_DIO0_MASK & RFLR_DIOMAPPING1_DIO2_MASK ) | RFLR_DIOMAPPING1_DIO0_00 | RFLR_DIOMAPPING1_DIO2_00 ); @@ -796,14 +798,15 @@ //RFLR_IRQFLAGS_PAYLOADCRCERROR | RFLR_IRQFLAGS_VALIDHEADER | RFLR_IRQFLAGS_TXDONE | - RFLR_IRQFLAGS_CADDONE | - RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL | - RFLR_IRQFLAGS_CADDETECTED ); + // RFLR_IRQFLAGS_CADDONE | + RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL //| + // RFLR_IRQFLAGS_CADDETECTED + ); // DIO0=RxDone Write( REG_DIOMAPPING1, ( Read( REG_DIOMAPPING1 ) & RFLR_DIOMAPPING1_DIO0_MASK ) | RFLR_DIOMAPPING1_DIO0_00 ); } - + Write( REG_LR_FIFORXBASEADDR, 0 ); Write( REG_LR_FIFOADDRPTR, 0 ); } @@ -926,7 +929,7 @@ RFLR_IRQFLAGS_VALIDHEADER | RFLR_IRQFLAGS_TXDONE | //RFLR_IRQFLAGS_CADDONE | - RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL // | + RFLR_IRQFLAGS_FHSSCHANGEDCHANNEL //| //RFLR_IRQFLAGS_CADDETECTED ); @@ -1078,6 +1081,7 @@ { __IO uint8_t irqFlags = 0; + //printf("radfta dio0irq\r\n"); switch( this->settings.State ) { case RX: @@ -1292,6 +1296,7 @@ void SX1276::OnDio1Irq( void ) { + printf("ondio1 irq\r\n"); switch( this->settings.State ) { case RX: @@ -1366,6 +1371,7 @@ void SX1276::OnDio2Irq( void ) { + // printf("ondio2 irq\r\n"); switch( this->settings.State ) { case RX: @@ -1430,6 +1436,7 @@ void SX1276::OnDio3Irq( void ) { + // printf("dio3 irq\r\n"); switch( this->settings.Modem ) { case MODEM_FSK: @@ -1438,15 +1445,18 @@ if( ( Read( REG_LR_IRQFLAGS ) & 0x01 ) == 0x01 ) { // Clear Irq + // printf("clear cad irq 1\r\n"); Write( REG_LR_IRQFLAGS, RFLR_IRQFLAGS_CADDETECTED_MASK | RFLR_IRQFLAGS_CADDONE); if( ( cadDone != NULL ) ) { + printf("call caddone with true"); cadDone( true ); } } else { // Clear Irq + // printf("clear cad irq 2 \r\n"); Write( REG_LR_IRQFLAGS, RFLR_IRQFLAGS_CADDONE ); if( ( cadDone != NULL ) ) { @@ -1480,6 +1490,7 @@ void SX1276::OnDio5Irq( void ) { + // printf("radfta dio5 irq\r\n"); switch( this->settings.Modem ) { case MODEM_FSK: