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: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/CommandParser/cmd.cpp
- Revision:
- 149:950c90425f7c
- Parent:
- 148:ee3cbaafe355
- Child:
- 150:4db35c8234b4
- Child:
- 158:36b5a9de58a1
--- a/src/CommandParser/cmd.cpp Wed Sep 28 17:57:36 2016 +0000 +++ b/src/CommandParser/cmd.cpp Fri Sep 30 12:22:20 2016 +0000 @@ -88,6 +88,8 @@ {"deep", "dump EEP", cmd_deep }, {"peep", "push EEP", cmd_peep }, {"ins-log", "insert log event", cmd_inslog }, + {"show-simin", "show simulated inputs", cmd_showSimin }, + {NULL, NULL, NULL} @@ -475,7 +477,7 @@ printf("\rFilename must be prefixed with control_tm_*\n"); return; } - + char time_buf[32]; sprintf(time_buf, "%lu", time(NULL)+5); @@ -487,15 +489,15 @@ "\"priority\": \"%s\", " "\"starttime\": \"%s\", " "\"duration\": \"%s\", ", argv[2], argv[3], argv[4], time_buf, argv[5] - ); - + ); + bool status = GLOBAL_mdot->saveUserFile(argv[1], (void *)data_buf, 1024); if( status != true ) { logInfo("(%d)save file failed, status=%d", __LINE__, status); return; } - + // send a message to the configuration handler to create the control Message_t *msg = MailBox.alloc(); memset(msg, 0, sizeof(Message_t)); @@ -917,10 +919,10 @@ { UNUSED(argc); UNUSED(argv); - + time_t rawtime; time(&rawtime); - + int iyr=0, imo=0, idy=0, ihr=0, imn=0, isc=0; rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc); printf("RTC time: %04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc); @@ -1054,4 +1056,12 @@ eventReason.outputValue = 0.0; strncpy(eventReason.outputTag, "o_stub01", sizeof(eventReason.outputTag) ); EventLoggerApi( eventReason ); +} + +void cmd_showSimin( int argc, char **argv ) +{ + std::map<std::string, SimulateInput>::iterator iter; + for (iter = SimulateInputMap.begin(); iter != SimulateInputMap.end(); ++iter) { + printf("simulated input=%s, min=%2.2f, max=%2.2f, start_value=%2.2f, step=%2.2f\r\n",iter->first.c_str(), SimulateInputMap[iter->first].min, SimulateInputMap[iter->first].max, SimulateInputMap[iter->first].start_value, SimulateInputMap[iter->first].step); + } } \ No newline at end of file