Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of d7a_1x by
Diff: src/d7a_modem.cpp
- Revision:
- 49:81d5bddb02f0
- Parent:
- 46:665391110051
- Child:
- 50:30440c9aeb7c
--- a/src/d7a_modem.cpp Fri Sep 02 10:07:12 2016 +0000 +++ b/src/d7a_modem.cpp Fri Sep 02 16:08:09 2016 +0000 @@ -17,6 +17,7 @@ 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; DigitalInOut* reset; @@ -27,7 +28,7 @@ void d7a_modem_thread(const void *p); -d7a_errors_t d7a_modem_open( PinName reset_pin ) +d7a_errors_t d7a_modem_open(PinName reset_pin, NotifDoneFunction nd) { FPRINT("\r\n"); @@ -36,7 +37,8 @@ g_modem_ctx.thread = new Thread(d7a_modem_thread, NULL, osPriorityHigh, DEFAULT_STACK_SIZE); g_modem_ctx.booted = false; g_modem_ctx.nb_files = 0; - + g_modem_ctx.notif_done = nd; + if (reset_pin == NC) { g_modem_ctx.reset = NULL; @@ -272,7 +274,10 @@ } else if (cmd == WM_NOTIF_DONE) { - d7a_fs_notif_done(pkt->buffer[1], pkt->buffer[2]); + if (g_modem_ctx.notif_done != NULL) + { + g_modem_ctx.notif_done(pkt->buffer[1], pkt->buffer[2]); + } } else {