Orefatoi / Mbed 2 deprecated test_afLib13_uart_180423

Dependencies:   vt100 mbed afLib_1_3

Revision:
0:87662653a3c6
diff -r 000000000000 -r 87662653a3c6 edge_utils/edge_mgr.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/edge_utils/edge_mgr.cpp	Mon Apr 23 06:15:26 2018 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "edge_mgr.h"
+#include "edge_reset_mgr.h"
+#include "af_attributes.h"
+
+#include "edge_time.h"
+#include "edge_pin.h"
+
+bool            verbos = true ;
+
+static int error_tolerance   = 100 ;
+static int loop_interval     = 100 ; // 1000 ; 
+int        edge_mgr_status   = EDGE_MGR_INIT ;
+char       *reset_reason_str = 0 ;
+
+int init_edge_attribute(void)
+{
+    static int attr_index = 0 ;
+    static int error_count = 0 ;
+    int return_value = 0 ;
+    int result ;
+     
+   
+    if (error_count > error_tolerance) { // too many fails, trying reset
+        reboot_edge() ;
+    }
+ 
+    return(return_value) ;
+}
+
+void edge_loop(uint32_t count_robin)
+{       
+    if ((count_robin % loop_interval) == 0) {
+        loop_interval = 1 ;
+    }
+}
+
+void   reboot_edge(void) 
+{
+    software_reset() ;
+}
\ No newline at end of file