Wi-Fi追加
Dependencies: RemoteIR TextLCD
Revision 26:0badbc9f9cb3, committed 2020-08-05
- Comitter:
- nishimura_taku_pet
- Date:
- Wed Aug 05 07:51:56 2020 +0000
- Parent:
- 25:8ed98982faa7
- Commit message:
- wifi mode change
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Aug 05 07:48:24 2020 +0000 +++ b/main.cpp Wed Aug 05 07:51:56 2020 +0000 @@ -1007,84 +1007,89 @@ pc.printf("+++++++++++++++++succed rec end+++++++++++++++++++++\r\n"); if( strstr(webdata, "GO") != NULL ) { pc.printf("+++++++++++++++++前進+++++++++++++++++++++\r\n"); - //run = ADVANCE; // 前進 + run = ADVANCE; // 前進 mode = READY; // モードs変更 -// display(); // ディスプレイ表示 - + display(); // ディスプレイ表示 } - + if( strstr(webdata, "LEFT") != NULL ) { pc.printf("+++++++++++++++++左折+++++++++++++++++++++\r\n"); - //run = LEFT; + run = LEFT; mode = READY; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 } if( strstr(webdata, "STOP") != NULL ) { pc.printf("+++++++++++++++++停止+++++++++++++++++++++\r\n"); -// run = STOP; + run = STOP; mode = READY; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 } if( strstr(webdata, "RIGHT") != NULL ) { pc.printf("+++++++++++++++++右折+++++++++++++++++++++\r\n"); -// run = RIGHT; + run = RIGHT; mode = READY; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 } if( strstr(webdata, "BACK") != NULL ) { pc.printf("+++++++++++++++++後進+++++++++++++++++++++\r\n"); -// run = BACK; + run = BACK; mode = READY; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 } pc.printf("+++++++++++++++++succed+++++++++++++++++++++"); if( strstr(webdata, "AVOIDANCE") != NULL ) { pc.printf("+++++++++++++++++AVOIDANCE+++++++++++++++++++++"); - //if(avoi_thread->get_state() == Thread::Deleted) { - // delete avoi_thread; - // avoi_thread = new Thread(avoidance); - // avoi_thread -> set_priority(osPriorityHigh); - //} + if(avoi_thread->get_state() == Thread::Deleted) { + delete avoi_thread; + avoi_thread = new Thread(avoidance); + avoi_thread -> set_priority(osPriorityHigh); + } mode=AVOIDANCE; -// run = ADVANCE; -// display(); // ディスプレイ表示 + run = ADVANCE; + display(); // ディスプレイ表示 } if( strstr(webdata, "LINE_TRACE") != NULL ) { pc.printf("+++++++++++++++++LINET RACE+++++++++++++++++++++"); pc.printf("mode = LINE_TRACE\r\n"); - //if(trace_thread->get_state() == Thread::Deleted) { - // delete trace_thread; - // trace_thread = new Thread(trace); - // trace_thread -> set_priority(osPriorityHigh); - //} + if(trace_thread->get_state() == Thread::Deleted) { + delete trace_thread; + trace_thread = new Thread(trace); + trace_thread -> set_priority(osPriorityHigh); + } mode=LINE_TRACE; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 } if( strstr(webdata, "Normal") != NULL ) { pc.printf("++++++++++++++++++Normal++++++++++++++++++++"); mode = SPEED; // スピードモード flag_sp = 0; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 mode = beforeMode; // 現在のモードに前回のモードを設定 } if( strstr(webdata, "Fast") != NULL ) { pc.printf("++++++++++++++++++++Fast++++++++++++++++++"); mode = SPEED; // スピードモード flag_sp = 1; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 mode = beforeMode; // 現在のモードに前回のモードを設定 } if( strstr(webdata, "VeryFast") != NULL ) { pc.printf("+++++++++++++++++++VeryFast+++++++++++++++++++"); - mode = SPEED; // スピードモード d + mode = SPEED; // スピードモード flag_sp = 2; -// display(); // ディスプレイ表示 + display(); // ディスプレイ表示 mode = beforeMode; // 現在のモードに前回のモードを設定 } + if(mode != LINE_TRACE && trace_thread->get_state() != Thread::Deleted){ + trace_thread->terminate(); + } + if(mode != AVOIDANCE && avoi_thread->get_state() != Thread::Deleted){ + avoi_thread->terminate(); + } sprintf(channel, "%d",linkID); if (strstr(webdata, "GET") != NULL) { servreq=1;