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: vt100 mbed afLib_1_3
Diff: edge_utils/edge_mgr.cpp
- Revision:
- 0:87662653a3c6
--- /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