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.
Diff: main.cpp
- Revision:
- 4:6547599b54a0
- Parent:
- 3:743125ca6a46
- Child:
- 5:8e64f59100e0
--- a/main.cpp	Mon Feb 06 12:18:29 2017 +0000
+++ b/main.cpp	Mon Feb 06 15:24:36 2017 +0000
@@ -87,6 +87,9 @@
 int TESTCOUNTER = 0;                                            // Variable to count number of cycles of main loop. Used to determine when to switch the pwm in this test version.
 
 int stateB_COUNTER = 0;                                         // Variable to count number of cycles of main loop. Used to reset charger from state B - 9V to state A and re-initiate charging.
+Watchdog wd;
+
+
 
 // ************************************************************
 // *   New Acquisition Routine for Capturing CP Signal Data   *                                    
@@ -244,6 +247,11 @@
     button.fall(&reset_pressed);                                // Attach interupt to button when pressed.
     button.rise(&reset_released);                               // Attach interupt to button when released.
     
+    if (wd.WatchdogCausedReset())
+       printf("Watchdog caused reset.\r\n");    
+
+    wd.Configure(5.0);
+    
     float reading_pp;                                           // Create variable to store pp reading.
     bool cable_32A = false;                                     // Create boolean to flag whether a 32 or 16A cable is being used. Default is 16A cable (cable_32A = false).
     bool cable_connected = false;                               // Create boolean to flag whether a cable is attached.