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.
System.h
- Committer:
- madcowswe
- Date:
- 2011-11-18
- Revision:
- 0:0bbf2f16da9c
File content as of revision 0:0bbf2f16da9c:
//General system functions
#include <string>
//
void kill(string reason = "Killed for no reason!") {
PWMleft = NOPOWER - 0.004;
PWMright = NOPOWER - 0.004;
PWMfront = NOPOWER - 0.004;
PWMrear = NOPOWER - 0.004;
//TODO: send this over RF as well..
pc.printf("%s\r\n", reason.c_str());
/*wait(0.5);
left = 0;
right = 0;
front = 0;
rear = 0;
*/
while (1);
}
//
void wdt() {
if (!loopalive)
kill("Killed by WDT: loop has stalled");
if (!commandsalive)
kill("Killed by WDT: command starvation");
loopalive = 0;
commandsalive = 0;
}