Revision d4c6efa9 devices/DiWheelDrive/main.cpp
devices/DiWheelDrive/main.cpp | ||
---|---|---|
908 | 908 |
chprintf(chp, "X:%i Y:%i\n",oldPos.x, oldPos.y); |
909 | 909 |
} |
910 | 910 |
|
911 |
|
|
912 |
void shellRequestErrorInfo(BaseSequentialStream *chp, int argc, char *argv[]){ |
|
913 |
// Print out the error info collected. Clear buffer after calling |
|
914 |
chprintf(chp, "Error Info\n"); |
|
915 |
chprintf(chp, "\n"); |
|
916 |
int IDLE = 0; |
|
917 |
int FOLLOW_LINE = 1; |
|
918 |
int DETECT_STATION = 2; |
|
919 |
int REVERSE = 3; |
|
920 |
int PUSH_BACK = 4; |
|
921 |
int CHECK_POSITIONING = 5; |
|
922 |
int CHECK_VOLTAGE = 6; |
|
923 |
int CHARGING = 7; |
|
924 |
int RELEASE = 8; |
|
925 |
int RELEASE_TO_CORRECT = 9; |
|
926 |
int CORRECT_POSITIONING = 10; |
|
927 |
int TURN = 12; |
|
928 |
int INACTIVE = 13; |
|
929 |
int CALIBRATION = 14; |
|
930 |
int CALIBRATION_CHECK = 15; |
|
931 |
int DEVIATION_CORRECTION = 16; |
|
932 |
int DOCKING_ERROR = 16+1; |
|
933 |
int REVERSE_TIMEOUT_ERROR = 16+2; |
|
934 |
int CALIBRATION_ERROR = 16+3; |
|
935 |
int WHITE_DETECTION_ERROR = 16+4; |
|
936 |
int PROXY_DETECTION_ERROR = 16+5; |
|
937 |
int NO_CHARGING_POWER_ERROR = 16+6; |
|
938 |
int UNKNOWN_STATE_ERROR = 16+7; |
|
939 |
|
|
940 |
chprintf(chp, "IDLE: %d\n", global.stateTracker[IDLE]); |
|
941 |
chprintf(chp, "FOLLOW_LINE: %d\n", global.stateTracker[FOLLOW_LINE]); |
|
942 |
chprintf(chp, "DETECT_STATION: %d\n", global.stateTracker[DETECT_STATION]); |
|
943 |
chprintf(chp, "REVERSE: %d\n", global.stateTracker[REVERSE]); |
|
944 |
chprintf(chp, "PUSH_BACK: %d\n", global.stateTracker[PUSH_BACK]); |
|
945 |
chprintf(chp, "CHECK_POSITIONING: %d\n", global.stateTracker[CHECK_POSITIONING]); |
|
946 |
chprintf(chp, "CHECK_VOLTAGE: %d\n", global.stateTracker[CHECK_VOLTAGE]); |
|
947 |
chprintf(chp, "CHARGING: %d\n", global.stateTracker[CHARGING]); |
|
948 |
chprintf(chp, "RELEASE: %d\n", global.stateTracker[RELEASE]); |
|
949 |
chprintf(chp, "RELEASE_TO_CORRECT: %d\n", global.stateTracker[RELEASE_TO_CORRECT]); |
|
950 |
chprintf(chp, "CORRECT_POSITIONING: %d\n", global.stateTracker[CORRECT_POSITIONING]); |
|
951 |
chprintf(chp, "TURN: %d\n", global.stateTracker[TURN]); |
|
952 |
chprintf(chp, "INACTIVE: %d\n", global.stateTracker[INACTIVE]); |
|
953 |
chprintf(chp, "CALIBRATION: %d\n", global.stateTracker[CALIBRATION]); |
|
954 |
chprintf(chp, "CALIBRATION_CHECK: %d\n", global.stateTracker[CALIBRATION_CHECK]); |
|
955 |
chprintf(chp, "DEVIATION_CORRECTION: %d\n", global.stateTracker[DEVIATION_CORRECTION]); |
|
956 |
chprintf(chp, "DOCKING_ERROR: %d\n", global.stateTracker[DOCKING_ERROR]); |
|
957 |
chprintf(chp, "REVERSE_TIMEOUT_ERROR: %d\n", global.stateTracker[REVERSE_TIMEOUT_ERROR]); |
|
958 |
chprintf(chp, "CALIBRATION_ERROR: %d\n", global.stateTracker[CALIBRATION_ERROR]); |
|
959 |
chprintf(chp, "WHITE_DETECTION_ERROR: %d\n", global.stateTracker[WHITE_DETECTION_ERROR]); |
|
960 |
chprintf(chp, "PROXY_DETECTION_ERROR: %d\n", global.stateTracker[PROXY_DETECTION_ERROR]); |
|
961 |
chprintf(chp, "NO_CHARGING_POWER_ERROR: %d\n", global.stateTracker[NO_CHARGING_POWER_ERROR]); |
|
962 |
chprintf(chp, "UNKNOWN_STATE_ERROR: %d\n", global.stateTracker[UNKNOWN_STATE_ERROR]); |
|
963 |
|
|
964 |
for (int i=0; i<24;i++){ |
|
965 |
global.stateTracker[i] = 0; |
|
966 |
} |
|
967 |
|
|
968 |
} |
|
969 |
|
|
911 | 970 |
static const ShellCommand commands[] = { |
912 | 971 |
{"shutdown", shellRequestShutdown}, |
913 | 972 |
{"wakeup", shellRequestWakeup}, |
... | ... | |
941 | 1000 |
{"printMagnetometerRes", shellRequestMagnetoMeterPrint}, |
942 | 1001 |
{"printLocation", shellRequestPrintCoordinate}, |
943 | 1002 |
{"checkPowerPins", shellRequestCheckPower}, |
1003 |
{"infos", shellRequestErrorInfo}, |
|
944 | 1004 |
{NULL, NULL} |
945 | 1005 |
}; |
946 | 1006 |
|
Also available in: Unified diff