Trond Enger / d7a_1x

Fork of d7a_1x by WizziLab

Revision:
29:8e7c5c1e9aab
Parent:
28:0376b97b4b55
Child:
30:d775c1409849
--- a/src/d7a_modem.cpp	Mon Apr 04 14:00:28 2016 +0000
+++ b/src/d7a_modem.cpp	Tue May 03 16:53:52 2016 +0000
@@ -4,6 +4,7 @@
 #include "d7a_com.h"
 #include "d7a_fs.h"
 #include "d7a_modem.h"
+#include "d7a_sys.h"
 #include "d7a_common.h"
 
 typedef struct {
@@ -38,6 +39,10 @@
     *(g_modem_ctx.reset) = 1;
     
     // Wait for modem ready
+    
+    //Thread::wait(100);
+    //ASSERT(d7a_sys_ping_modem(), "MODEM BOOT Timeout\r\n");
+    
     osEvent evt = g_modem_ctx.boot.get(1000);
     ASSERT(evt.status == osEventMessage, "MODEM BOOT Timeout\r\n");
 }
@@ -45,7 +50,7 @@
 
 int32_t d7a_modem_wait_ready( uint32_t millisec )
 {
-    //FPRINT("(%d)\r\n", ++g_modem_ctx.waiting_count);
+    FPRINT("(%d)\r\n", ++g_modem_ctx.waiting_count);
     int32_t ret;
     osEvent evt = g_modem_ctx.ready.get(millisec);
     if (evt.status == osEventMessage)
@@ -134,9 +139,9 @@
     };
 
     d7a_modem_msg(WM_CMD_NOTIFY_FILE,(uint8_t*)&nfp,sizeof(notify_file_param_t));
-    d7a_modem_wait_ready();
+    WARNING(d7a_modem_wait_ready(1000) != 0xFFFFFFFF, "Notification Timeout\r\n");
     
-    Thread::wait(100); // XXX: To avoid concurrent file access
+    //Thread::wait(100); // XXX: To avoid concurrent file access
     
     g_modem_ctx.ressource->release();
 }
@@ -179,7 +184,7 @@
                 uint8_t cmd = pkt->buffer[0];
                 if (cmd == WM_CMD_READY)
                 {
-                    //FPRINT("(Modem ready (%d))\r\n", --g_modem_ctx.waiting_count);
+                    FPRINT("(Modem ready (%d))\r\n", --g_modem_ctx.waiting_count);
                     g_modem_ctx.ready.put(NULL);
                 }
                 else if (cmd == WM_CMD_BOOT)