
ジョイスティック切換えで色々な処理をやります。 C言語学習用です。
Dependencies: C12832 MMA7660 mbed
Diff: src/main.cpp
- Revision:
- 15:56e31e726469
- Parent:
- 14:15447d4751c3
- Child:
- 19:caab1538fa62
--- a/src/main.cpp Wed Apr 11 18:13:13 2018 +0900 +++ b/src/main.cpp Wed Apr 11 19:47:37 2018 +0900 @@ -22,13 +22,17 @@ } COMMAND_TRRIGER *current = &triggerNull; + COMMAND_TRRIGER *previous = NULL; while(true) { // 要求の取得 COMMAND_TRRIGER *request = NULL; for(int index = 0; commandList[index].trigger != nothing; index++) { if (joyStick == commandList[index].trigger) { - request = &commandList[index]; + if (previous != &commandList[index]) { + request = &commandList[index]; + previous = request; + } } }