SX1276 library for modtronix inair9. Edited for use with NRF51DK board.

Dependents:   InAir9_PingPong

Fork of SX1276Lib_modtronix by modtronix H

Revision:
25:72381be1b0ce
Parent:
22:20db480143c9
Child:
26:ad32782125eb
diff -r 1346d1c71c40 -r 72381be1b0ce sx1276/sx1276.cpp
--- a/sx1276/sx1276.cpp	Fri Jul 24 21:35:37 2015 +1000
+++ b/sx1276/sx1276.cpp	Wed Jul 29 12:07:40 2015 +1000
@@ -44,12 +44,12 @@
 SX1276::SX1276( void ( *txDone )( ), void ( *txTimeout ) ( ), void ( *rxDone ) ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ), 
                 void ( *rxTimeout ) ( ), void ( *rxError ) ( ), void ( *fhssChangeChannel ) ( uint8_t channelIndex ), void ( *cadDone ) ( bool channelActivityDetected ),
                 PinName mosi, PinName miso, PinName sclk, PinName nss, PinName reset,
-                PinName dio0, PinName dio1, PinName dio2, PinName dio3, PinName dio4, PinName dio5 )
+                PinName dio0, PinName dio1, PinName dio2, PinName dio3/*, PinName dio4, PinName dio5*/)
             :   Radio( txDone, txTimeout, rxDone, rxTimeout, rxError, fhssChangeChannel, cadDone ),
                 spi( mosi, miso, sclk ),
                 nss( nss ),
                 reset( reset ),
-                dio0( dio0 ), dio1( dio1 ), dio2( dio2 ), dio3( dio3 ), dio4( dio4 ), dio5( dio5 ),
+                dio0( dio0 ), dio1( dio1 ), dio2( dio2 ), dio3( dio3 ), /*dio4( dio4 ), dio5( dio5 ),*/
                 isRadioActive( false )
 {
     wait_ms( 10 );
@@ -68,8 +68,8 @@
     #else
     this->dioIrq[3] = &SX1276::OnDio3Irq;
     #endif    
-    this->dioIrq[4] = &SX1276::OnDio4Irq;
-    this->dioIrq[5] = NULL;
+    //this->dioIrq[4] = &SX1276::OnDio4Irq;
+    //this->dioIrq[5] = NULL;
     
     this->settings.State = IDLE;
 }
@@ -823,7 +823,7 @@
 
     memset( rxBuffer, 0, ( size_t )RX_BUFFER_SIZE );
 
-    this->settings.State = RX;
+    this->settings.State = RX_DONE;
     if( timeout != 0 )
     {
         rxTimeoutTimer.attach_us( this, &SX1276::OnTimeoutIrq, timeout );
@@ -912,7 +912,7 @@
         break;
     }
 
-    this->settings.State = TX;
+    this->settings.State = TX_DONE;
     txTimeoutTimer.attach_us( this, &SX1276::OnTimeoutIrq, timeout );
     SetOpMode( RF_OPMODE_TRANSMITTER );
 }
@@ -1032,7 +1032,7 @@
 {
     switch( this->settings.State )
     {
-    case RX:
+    case RX_DONE:
         if( this->settings.Modem == MODEM_FSK )
         {
             this->settings.FskPacketHandler.PreambleDetected = false;
@@ -1062,7 +1062,7 @@
             rxTimeout( );
         }
         break;
-    case TX:
+    case TX_DONE:
         this->settings.State = IDLE;
         if( ( txTimeout != NULL ) )
         {
@@ -1080,7 +1080,7 @@
   
     switch( this->settings.State )
     {                
-        case RX:
+        case RX_DONE:
             //TimerStop( &RxTimeoutTimer );
             // RxDone interrupt
             switch( this->settings.Modem )
@@ -1251,7 +1251,7 @@
                 break;
             }
             break;
-        case TX:
+        case TX_DONE:
             txTimeoutTimer.detach(  );
             // TxDone interrupt
             switch( this->settings.Modem )
@@ -1279,7 +1279,7 @@
 {
     switch( this->settings.State )
     {                
-        case RX:
+        case RX_DONE:
             switch( this->settings.Modem )
             {
             case MODEM_FSK:
@@ -1321,7 +1321,7 @@
                 break;
             }
             break;
-        case TX:
+        case TX_DONE:
             switch( this->settings.Modem )
             {
             case MODEM_FSK:
@@ -1353,7 +1353,7 @@
 {
     switch( this->settings.State )
     {                
-        case RX:
+        case RX_DONE:
             switch( this->settings.Modem )
             {
             case MODEM_FSK:
@@ -1387,7 +1387,7 @@
                 break;
             }
             break;
-        case TX:
+        case TX_DONE:
             switch( this->settings.Modem )
             {
             case MODEM_FSK:
@@ -1444,6 +1444,7 @@
     }
 }
 
+/*
 void SX1276::OnDio4Irq( void )
 {
     switch( this->settings.Modem )
@@ -1475,3 +1476,4 @@
         break;
     }
 }
+*/