wdg

Dependencies:   Watchdog mbed-stm32l0/l1-src

Files at this revision

API Documentation at this revision

Comitter:
lzbpli
Date:
Fri Apr 29 02:05:00 2016 +0000
Commit message:
sanfan-wdg

Changed in this revision

Watchdog.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-stm32l0l1-src.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r ac1835f6cf90 Watchdog.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Watchdog.lib	Fri Apr 29 02:05:00 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/lzbpli/code/Watchdog/#1c21c1f9c7b6
diff -r 000000000000 -r ac1835f6cf90 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 29 02:05:00 2016 +0000
@@ -0,0 +1,21 @@
+#include "Watchdog.h"
+ 
+Watchdog wd;
+Serial pc(PB_6,PB_7);
+DigitalOut myled(PB_3);
+ 
+//...
+int main() {
+   pc.baud(115200); 
+   pc.printf("hello\r\n");
+   if (wd.WatchdogCausedReset())
+       pc.printf("Watchdog caused reset.\r\n");
+   pc.printf("hello!!\r\n");   
+   wd.Configure(3.0);       // sets the timeout interval
+   for (;;) {
+        wd.Service();       // kick the dog before the timeout
+        // do other work
+        pc.printf("hello!!!!\r\n"); 
+        wait(1); 
+   }
+}
\ No newline at end of file
diff -r 000000000000 -r ac1835f6cf90 mbed-stm32l0l1-src.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-stm32l0l1-src.lib	Fri Apr 29 02:05:00 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/lzbpli/code/mbed-stm32l0l1-src/#cdb71f051ab2