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_sys.cpp
- Revision:
- 34:1311cc53201a
- Parent:
- 31:ab9bfdbc6b44
- Child:
- 40:b4df548bd9d8
- Child:
- 43:28202405094d
--- a/src/d7a_sys.cpp Fri Jun 24 10:11:19 2016 +0000 +++ b/src/d7a_sys.cpp Mon Aug 22 13:47:39 2016 +0000 @@ -20,6 +20,7 @@ void d7a_sys_open( void ) { FPRINT("\r\n"); + g_sys_ctx.thread = new Thread(d7a_sys_thread, NULL, osPriorityHigh, DEFAULT_STACK_SIZE); } @@ -63,10 +64,9 @@ void d7a_sys_software_reset(void) { FPRINT("\r\n"); - d7a_com_tx_msg_t msg; uint8_t buf[4] = "RST"; - d7a_com_dump(buf, 3, KAL_COM_FLOW_SYS_RST); + d7a_com_force_dump(buf, 3, KAL_COM_FLOW_SYS_RST); } void d7a_sys_button(uint8_t button) @@ -77,6 +77,11 @@ d7a_com_dump(&button, 1, KAL_COM_FLOW_SYS_BUTTON); } +void d7a_sys_xack(void) +{ + uint8_t buf[] = "X"; + d7a_com_dump(buf, 1, KAL_COM_FLOW_SYS_XACK); +} void d7a_sys_thread(const void *p) { @@ -106,16 +111,11 @@ break; case KAL_COM_FLOW_SYS_PING: IPRINT("KAL_COM_FLOW_SYS_PING\r\n"); - d7a_com_tx_msg_t msg; uint8_t buf[5] = "PONG"; - msg.id = KAL_COM_FLOW_SYS_PONG; - msg.pbuf = buf; - msg.plen = 4; - msg.alen = 0; - d7a_com_send_msg(&msg); + d7a_com_dump(buf, 4, KAL_COM_FLOW_SYS_PONG); break; case KAL_COM_FLOW_SYS_PONG: - IPRINT("KAL_COM_FLOW_SYS_PONG\r\n"); + //IPRINT("KAL_COM_FLOW_SYS_PONG\r\n"); g_sys_ctx.wait_pong.put(NULL); break; case KAL_COM_FLOW_SYS_CFG: