Data reception demo.

Dependencies:   modem_ref_helper CRC

Revision:
12:404a3ca64a44
Parent:
11:7df24b241621
Child:
14:44cbb58de405
--- a/main.cpp	Thu Oct 11 14:46:39 2018 +0000
+++ b/main.cpp	Fri Aug 02 15:56:17 2019 +0000
@@ -56,7 +56,7 @@
         {
             // Keep alive: Report status
             modem_write_file(FID_STATUS_FILE, &status, 0, SIZE_STATUS_FILE, id);
-            modem_ready.wait();
+            modem_ready.acquire();
         }
         
         Thread::wait(1000);
@@ -141,20 +141,20 @@
     // Put modem to listen to this access class
     d7a_xcl_t my_xcl = { .bf.s = 0, .bf.m = 2 };
     modem_write_file(D7A_FID_DLL_CFG, &my_xcl, 0, sizeof(d7a_xcl_t), id);
-    modem_ready.wait();
+    modem_ready.acquire();
 
     // 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;
@@ -185,10 +185,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