ST-DEVKIT-LRWAN

Dependents:   DISCO-L072CZ-LRWAN1-base

Fork of SX1276GenericLib by Helmut Tschemernjak

Revision:
20:e05596ba4166
Parent:
19:71a47bb03fbb
Child:
21:2e496deb7858
--- a/sx1276/sx1276.cpp	Wed Aug 12 14:34:03 2015 +0000
+++ b/sx1276/sx1276.cpp	Tue Oct 20 12:58:58 2015 +0000
@@ -992,6 +992,24 @@
     }
 }
 
+void SX1276::SetMaxPayloadLength( ModemType modem, uint8_t max )
+{
+    this->SetModem( modem );
+
+    switch( modem )
+    {
+    case MODEM_FSK:
+        if( this->settings.Fsk.FixLen == false )
+        {
+            this->Write( REG_PAYLOADLENGTH, max );
+        }
+        break;
+    case MODEM_LORA:
+        this->Write( REG_LR_PAYLOADMAXLENGTH, max );
+        break;
+    }
+}
+
 void SX1276::OnTimeoutIrq( void )
 {
     switch( this->settings.State )
@@ -1040,7 +1058,7 @@
 
 void SX1276::OnDio0Irq( void )
 {
-    __IO uint8_t irqFlags = 0;
+    volatile uint8_t irqFlags = 0;
   
     switch( this->settings.State )
     {