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.
Dependencies: C12832 MMA7660 mbed
Diff: main.cpp
- Revision:
- 10:9ca51c678bec
- Parent:
- 9:35c816293400
- Child:
- 11:28887549c7d5
diff -r 35c816293400 -r 9ca51c678bec main.cpp
--- a/main.cpp Wed Mar 28 18:59:22 2018 +0900
+++ b/main.cpp Wed Mar 28 11:10:15 2018 +0000
@@ -3,8 +3,8 @@
#include "commands.h"
-extern COMMAND_TRRIGER *commandList[];
-extern COMMAND_TRRIGER Command_null;
+extern COMMAND_TRRIGER commandList[];
+extern COMMAND_TRRIGER trrigerNull;
BusIn joy(p15,p12,p13,p16);
DigitalIn fire(p14);
@@ -16,22 +16,22 @@
lcd.locate(0,3);
lcd.printf("mbed Switches application");
- for(int index = 0; commandList[index]->trigger != 0x00; index++) {
- commandList[index]->command->initialize();
+ for(int index = 0; commandList[index].trigger != 0x00; index++) {
+ commandList[index].command->initialize();
}
- COMMAND_TRRIGER *current = &Command_null;
+ COMMAND_TRRIGER *current = &trrigerNull;
while(true) {
COMMAND_TRRIGER *request = NULL;
int trigger = fire ? 0xff : joy;
- for(int index = 0; commandList[index]->trigger != 0x00; index++) {
- if (trigger == commandList[index]->trigger) {
- request = commandList[index];
+ for(int index = 0; commandList[index].trigger != 0x00; index++) {
+ if (trigger == commandList[index].trigger) {
+ request = &commandList[index];
}
}
if (request != NULL && request != current) {
current->command->finalize();
- current = &Command_null;
+ current = &trrigerNull;
}
if (current->trigger == 0x00) {
if (request != NULL){
@@ -46,7 +46,7 @@
current->command->processRunning();
if (! current->command->processIsContinue()){
current->command->finalize();
- current = &Command_null;
+ current = &trrigerNull;
}
}
}