Seongdo Yoo / Mbed 2 deprecated SX1276PingPongFHSS_f401

Dependencies:   SX1276Lib mbed

Fork of SX1276PingPongFHSS by Semtech

Files at this revision

API Documentation at this revision

Comitter:
mluis
Date:
Thu Nov 26 12:36:31 2015 +0000
Parent:
3:99bd9ae6906f
Child:
5:b07ae0f2ae05
Commit message:
Adapted application to new version of SX1276Lib radio driver

Changed in this revision

SX1276Lib.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/SX1276Lib.lib	Tue Dec 16 12:52:53 2014 +0000
+++ b/SX1276Lib.lib	Thu Nov 26 12:36:31 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/GregCr/code/SX1276Lib/#618826a997e2
+http://developer.mbed.org/teams/Semtech/code/SX1276Lib/#2e496deb7858
--- a/main.cpp	Tue Dec 16 12:52:53 2014 +0000
+++ b/main.cpp	Thu Nov 26 12:36:31 2015 +0000
@@ -58,13 +58,33 @@
 /*
  *  Global variables declarations
  */
-typedef RadioState States_t;
-volatile States_t State = LOWPOWER;
+typedef enum
+{
+    LOWPOWER = 0,
+    IDLE,
+    
+    RX,
+    RX_TIMEOUT,
+    RX_ERROR,
+    
+    TX,
+    TX_TIMEOUT,
+    
+    CAD,
+    CAD_DONE
+}AppStates_t;
+
+volatile AppStates_t State = LOWPOWER;
+
+/*!
+ * Radio events function pointer
+ */
+static RadioEvents_t RadioEvents;
 
 /*
  *  Global variables declarations
  */
-SX1276MB1xAS Radio( OnTxDone, OnTxTimeout, OnRxDone, OnRxTimeout, OnRxError, OnFhssChangeChannel, NULL );
+SX1276MB1xAS Radio( NULL );
 
 const uint8_t PingMsg[] = "PING";
 const uint8_t PongMsg[] = "PONG";
@@ -81,6 +101,15 @@
     bool isMaster = true;
     
     debug( "\n\n\r     SX1276 Ping Pong Demo Application \n\n\r" );
+
+    // Initialize Radio driver
+    RadioEvents.TxDone = OnTxDone;
+    RadioEvents.RxDone = OnRxDone;
+    RadioEvents.RxError = OnRxError;
+    RadioEvents.TxTimeout = OnTxTimeout;
+    RadioEvents.RxTimeout = OnRxTimeout;
+    RadioEvents.FhssChangeChannel = OnFhssChangeChannel;
+    Radio.Init( &RadioEvents );
     
     // verify the connection with the board
     while( Radio.Read( REG_VERSION ) == 0x00  )
--- a/mbed.bld	Tue Dec 16 12:52:53 2014 +0000
+++ b/mbed.bld	Thu Nov 26 12:36:31 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11
\ No newline at end of file