Ping pong app demo.
Dependencies: modem_ref_helper DebouncedInterrupt
Diff: main.cpp
- Revision:
- 10:b69fe2a98432
- Parent:
- 9:63592df2faad
- Child:
- 11:aa9c3fdf2303
--- a/main.cpp Thu Oct 11 14:34:17 2018 +0000 +++ b/main.cpp Fri Aug 02 14:25:36 2019 +0000 @@ -144,7 +144,7 @@ my_led = 1; #endif - Thread::wait(PING_DELAY); + ThisThread::sleep_for(PING_DELAY); #ifdef DEBUG_LED my_led = 0; @@ -186,12 +186,12 @@ { // Wait for button press PRINT("PRESS BUTTON TO INITIATE PING...\n"); - button_user.wait(); + button_user.acquire(); // Initiate ping PRINT("Initiate PING\n"); modem_send_file_content((uint8_t*)&my_itf, D7_ITF_SIZE(&my_itf), NULL, FID_PING_PONG, &ping, 0, PING_COUNTER_SIZE, g_main_id); - modem_ready[g_main_id].wait(); + modem_ready[g_main_id].acquire(); } } @@ -232,11 +232,11 @@ // Put modem to listen to this access class modem_write_file(D7A_FID_DLL_CFG, &ping_pong_xcl, 0, sizeof(d7a_xcl_t), g_main_id); - modem_ready[g_main_id].wait(); + modem_ready[g_main_id].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, g_main_id); - modem_ready[g_main_id].wait(); + modem_ready[g_main_id].acquire(); #ifdef DEBUG_BUTTON DebouncedInterrupt user_interrupt(DEBUG_BUTTON); @@ -248,9 +248,9 @@ #endif // Set main task to lowest priority - osThreadSetPriority(osThreadGetId(), osPriorityIdle); + osThreadSetPriority(osThreadGetId(), osPriorityLow); while(true) { - Thread::wait(500); + ThisThread::sleep_for(500); } } \ No newline at end of file