Anish updated the code to work with L152. RTC seems to causing issue. Will have to disable LSE.

Dependencies:   mbed LoRaWAN-lib SX1276Lib

Revision:
14:9ba8f6975308
Parent:
13:831ffc0ea56c
Child:
15:f4805eb13d73
--- a/app/main.cpp	Thu Jan 03 17:06:18 2019 +0000
+++ b/app/main.cpp	Wed Jan 09 16:07:08 2019 +0000
@@ -148,7 +148,7 @@
 AnalogIn LIGHT_2_PIN(A5);
 AnalogIn VCE_PIN(PB_1);
 
-InterruptIn button1(D14);
+InterruptIn button1(USER_BUTTON);
 volatile bool button1_pressed = false; // Used in the main loop
 volatile bool button1_enabled = true; // Used for debouncing
 Timeout button1_timeout; // Used for debouncing
@@ -353,16 +353,6 @@
     }
 }
 
-
-void flash_builtin() {
-    myled = 1;   // turn the LED on (HIGH is the voltage level)
-    wait(2);                       // wait for a second
-    myled = 0;    // turn the LED off by making the voltage LOW
-    wait(1);                       // wait for a second
-}
-
-
-
 // ****************************    COMMUNICATION PACKET DEFINITION METHODS   ********************************   //
 
 void heartbeat_message(uint8_t *hb_data, uint8_t *current_date) {
@@ -904,9 +894,6 @@
 }
 
 void startTest(uint8_t *measurements) {
-  // Signal that test is running
-    flash_builtin();
-    flash_builtin();
     
     // Determine test length & measurement interval
     switch (MessageType)
@@ -995,10 +982,6 @@
     press_count = 0;
 }
 
-
-
-
-
 /**
  * Main application entry point.
  */
@@ -1072,20 +1055,14 @@
 
 
 
-/**
- * Main application entry point.
- */
 int main( void )
 {
-
     pc.printf("mbed-os-rev: %d.%d.%d   lib-rev: %d\r\n", \
             MBED_MAJOR_VERSION, MBED_MINOR_VERSION,MBED_PATCH_VERSION,MBED_LIBRARY_VERSION);
     pc.printf("BUILD= %s, SysClock= %d, RCC= %0X\r\n", __TIME__, SystemCoreClock, RCC->CR);   
     my_patch();
     pc.printf("NEW SysClock= %d, NEW RCC= %0X\r\n", SystemCoreClock, RCC->CR);
     wait(3);
-    
-    
     LoRaMacPrimitives_t LoRaMacPrimitives;
     LoRaMacCallback_t LoRaMacCallbacks;
     MibRequestConfirm_t mibReq;
@@ -1108,14 +1085,6 @@
     set_time(1514764800);
     relayPin = 0;
     
-
-
-    flash_builtin();
-    flash_builtin();
-    flash_builtin();
-    flash_builtin();
-    
-    
     running_test = false;
     joining = true;
     received_downlink = false;