Send file data demo.

Dependencies:   modem_ref_helper CRC DebouncedInterrupt

Revision:
17:d50191689d1f
Parent:
16:355dcd95c082
Child:
19:68f3a84dbc8f
--- a/main.cpp	Thu Oct 11 14:50:34 2018 +0000
+++ b/main.cpp	Fri Aug 02 16:09:15 2019 +0000
@@ -81,7 +81,7 @@
     }
     
     // Wait end of user processing before resuming
-    user_ready.wait();
+    user_ready.acquire();
 }
 
 void button_user_thread()
@@ -102,7 +102,7 @@
     
     // Send initial value
     modem_send_file_content((uint8_t*)&alarm_itf, D7_ITF_SIZE(&alarm_itf), (void*)&istat, FID_ALARM, &alarm, 0, 1, id);
-    modem_ready.wait();
+    modem_ready.acquire();
     
     // Change callback
     modem_free_id(id);
@@ -112,7 +112,7 @@
     {
         // Wait for button press
         PRINT("PRESS BUTTON TO SEND ALARM...\r\n");
-        button_user.wait();
+        button_user.acquire();
         
         nb = 0;
         
@@ -229,15 +229,15 @@
     // Configure URC: LQUAL on report file notification every 10 reports
     PRINT("Setup URCs\n");
     modem_enable_urc(ALP_URC_TYPE_LQUAL, IFID_REPORT, 10, true, id);
-    modem_ready.wait();
+    modem_ready.acquire();
     
     PRINT("Start D7A Stack\n");
     modem_activate_itf(ALP_ITF_TYPE_D7A, 24, 0, ALP_D7A_ISTAT_RESP | ALP_D7A_ISTAT_UNS | ALP_D7A_ISTAT_EOP, true, id);
-    modem_ready.wait();
+    modem_ready.acquire();
     
     PRINT("Notify Modem Version\n");
     modem_notify_file(D7A_FID_FIRMWARE_VERSION, 0, SIZE_HOST_REV, id);
-    modem_ready.wait();
+    modem_ready.acquire();
     
     PRINT("Notify FW Version\n");
     uint8_t default_root_key[16] = DEFAULT_ROOT_KEY;
@@ -259,10 +259,10 @@
 #endif
     
     // Set main task to lowest priority
-    osThreadSetPriority(osThreadGetId(), osPriorityIdle);
+    osThreadSetPriority(osThreadGetId(), osPriorityLow);
     while(true)
     {
-        Thread::wait(500);
+        ThisThread::sleep_for(500);
 #ifdef DEBUG_LED
         my_led = !my_led;
 #endif