Trond Enger / d7a_1x

Fork of d7a_1x by WizziLab

Revision:
76:fda2e34ff19d
Parent:
75:305024138382
Child:
77:8c792719a1fc
diff -r 305024138382 -r fda2e34ff19d src/d7a_modem.cpp
--- a/src/d7a_modem.cpp	Fri Dec 16 16:04:27 2016 +0000
+++ b/src/d7a_modem.cpp	Tue Dec 20 09:30:14 2016 +0000
@@ -16,7 +16,6 @@
     Queue<void, 8> ready;
     Queue<void, 2> boot;
     Queue<d7a_com_rx_msg_t, 16> pkt_queue;
-    Queue<register_file_param_t, 64> registered_files;
     NotifDoneFunction notif_done;
     uint8_t nb_files;
     int8_t status;
@@ -26,7 +25,7 @@
 
 d7a_modem_ctx_t g_modem_ctx;
 
-void d7a_modem_thread(const void *p);
+void d7a_modem_thread();
 
 d7a_errors_t d7a_modem_open(PinName reset_pin, NotifDoneFunction nd)
 {
@@ -34,7 +33,11 @@
     
     d7a_errors_t err;
     
-    g_modem_ctx.thread = new Thread(d7a_modem_thread, NULL, osPriorityHigh, DEFAULT_STACK_SIZE*2);
+    g_modem_ctx.thread = new Thread(osPriorityHigh, DEFAULT_STACK_SIZE*2, NULL);
+    
+    osStatus error = g_modem_ctx.thread->start(d7a_modem_thread);
+    ASSERT(error == osOK, "Failed to start d7a_modem_thread (err: %d)\r\n", error);
+    
     g_modem_ctx.booted = false;
     g_modem_ctx.nb_files = 0;
     g_modem_ctx.notif_done = nd;
@@ -118,8 +121,8 @@
     d7a_errors_t err = D7A_ERR_UNKNOWN;
     g_modem_ctx.booted = false;
 
-    d7a_modem_soft_reset();
-    err = d7a_modem_wait_boot(5000);
+    //d7a_modem_soft_reset();
+    //err = d7a_modem_wait_boot(5000);
     
     if (err)
     {
@@ -213,7 +216,7 @@
     return err;
 }
 
-void d7a_modem_thread(const void *p)
+void d7a_modem_thread()
 {
     FPRINT("(id:0x%08x)\r\n", osThreadGetId());
     d7a_com_rx_msg_t* pkt;