![](/media/cache/profiles/ndu.jpg.50x50_q85.jpg)
keyboard input, serial com test
Dependencies: mbed DISCO_L475VG_IOT01A_wifi TextLCD USBHost
Diff: main.cpp
- Revision:
- 6:9d975a9d2728
- Parent:
- 5:0466445897b8
--- a/main.cpp Sat Aug 10 08:34:41 2019 +0000 +++ b/main.cpp Thu Aug 15 19:33:04 2019 +0000 @@ -1,26 +1,42 @@ #include "mbed.h" -#include "inc/display.h" -#include "inc/input.h" +#include "rtos.h" +#include "inc/server.h" +#include "inc/massStorage.h" +#include "inc/config.h" + +#include <string> DigitalOut led1(LED1); Serial pc(SERIAL_TX, SERIAL_RX); +const int TASK_PROGRAMM_DELAY_MS = 4000; +const int TASK_LED_DELAY_MS = 100; +void program_task(void const *){ + while(1){ + Thread::wait(TASK_PROGRAMM_DELAY_MS); + printf("prgramm running\r\n"); + } +} + +void led_task(void const *) { + while(1){ + led1 = !led1; + Thread::wait(TASK_LED_DELAY_MS); + } +} int main() -{ - displayInit(); - inputInit(); - +{ + pc.baud(115200); pc.printf("start main()\n\r"); + + Thread msdTask(massStorage_task, NULL, osPriorityNormal, 1024 * 4); + Thread ledTask(led_task, NULL, osPriorityNormal, 1024 * 4); + Thread programTask(program_task, NULL, osPriorityNormal, 1024 * 4); + Thread serverTask(server_task, NULL, osPriorityNormal, 1024 * 4); + while(1) { - - - pc.printf("last key:%d \n\r", getKey()); - displayScreen(1); - wait(1); - led1 = !led1; - displayScreen(0); - wait(1); + wait(0.5); } }