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: STM_ResetSupervisor USBDevice
main.cpp
00001 #include "mbed.h" 00002 #include "ResetSupervisor.h" 00003 00004 int i = 1; 00005 00006 #include "USBSerial.h" 00007 00008 /******************** Comms *********************/ 00009 USBSerial pc; 00010 FileHandle* mbed::mbed_override_console(int) 00011 { 00012 return &pc; 00013 } 00014 00015 Supervisor foreman; 00016 int main(void) 00017 { 00018 wait(1); 00019 00020 foreman.initWD(5); // turn on the Watchdog Timer and set it for 5 seconds 00021 if(foreman.resetReason() == RCC_FLAG_IWDGRST) 00022 pc.printf("Watchdog Reset!\n"); 00023 00024 while(1) 00025 { 00026 pc.printf("Hello! I'm working! Iteration: %d \n", i); 00027 wait(1); 00028 00029 if (i == 10) { 00030 wait(10); 00031 } 00032 00033 00034 foreman.pingWD(); 00035 i++; 00036 } 00037 }
Generated on Wed Jul 13 2022 19:37:16 by
1.7.2