Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
33:735fd60e96d8
Parent:
21:0bd688722e81
Child:
81:3656f00ab3db
--- a/wdt.cpp	Thu Sep 25 19:46:37 2014 +0000
+++ b/wdt.cpp	Tue Sep 30 11:37:31 2014 +0000
@@ -1,5 +1,6 @@
 #include "mbed.h"
 #include "wdt.h"
+#include "debug.h"
  
  /// Watchdog gets instantiated at the module level
 Watchdog::Watchdog() {
@@ -12,15 +13,26 @@
     uint32_t clk = 500000 / 4;    // WD has a fixed /4 prescaler, and a 500khz oscillator
     LPC_WDT->TC = (uint32_t)(s * (float)clk);
     LPC_WDT->MOD = 0x3;                   // Enabled and Reset
-    kick();
+//    kick();
+//    debug_msg("");
 }
  
 /// "Service", "kick" or "feed" the dog - reset the watchdog timer
 /// by writing this required bit pattern
 void Watchdog::kick() {
     //x = NVIC_disable_IRQ();
+    /*
+        antes de desabilitar as irqs, eu preciso salvar o status delas
+    */
+    //IRQn irqn;
+    //uint16_t ret = NVIC_GetActive( irqn );
+    //debug_msg( "NVIC_GetActive --%i--", ret );
+    //debug_msg("+");
+    //__disable_irq();
+    //Interrupt ID == 0 -- Exception Number 16
     LPC_WDT->FEED = 0xAA;
     LPC_WDT->FEED = 0x55;
-    //if (x) enable_IRQ() ;
-}
- 
\ No newline at end of file
+    
+    //__enable_irq();
+    //debug_msg(".");
+}
\ No newline at end of file