![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
wdt_manager.h@121:ee02790d00b7, 2015-05-08 (annotated)
- Committer:
- klauss
- Date:
- Fri May 08 04:15:23 2015 +0000
- Revision:
- 121:ee02790d00b7
- Parent:
- 119:ee6a53069455
- Child:
- 122:480c44b0e205
compiling
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 74:81c47fff88a5 | 1 | #ifndef __WDT_MANAGER_H__ |
klauss | 74:81c47fff88a5 | 2 | #define __WDT_MANAGER_H__ |
klauss | 74:81c47fff88a5 | 3 | |
klauss | 121:ee02790d00b7 | 4 | #include "EthernetInterface.h" |
klauss | 78:1353744f01e1 | 5 | #include "mbed.h" |
klauss | 74:81c47fff88a5 | 6 | #include "wdt.h" |
klauss | 74:81c47fff88a5 | 7 | |
klauss | 74:81c47fff88a5 | 8 | extern Watchdog wdt; |
klauss | 81:3656f00ab3db | 9 | extern Timer wdt_timer; |
klauss | 81:3656f00ab3db | 10 | |
klauss | 82:f55d13babca0 | 11 | extern UDPSocket udp_wdt_client; |
klauss | 82:f55d13babca0 | 12 | |
klauss | 119:ee6a53069455 | 13 | const char EXTERNAL_WDT_IP[] = "192.168.120.144"; |
klauss | 119:ee6a53069455 | 14 | const uint16_t EXTERNAL_WDT_SERVER_PORT = 9395; |
klauss | 119:ee6a53069455 | 15 | const uint16_t EXTERNAL_WDT_HEADER_PORT = 6612; |
klauss | 82:f55d13babca0 | 16 | |
klauss | 119:ee6a53069455 | 17 | inline int init_wdt () |
klauss | 119:ee6a53069455 | 18 | { |
klauss | 119:ee6a53069455 | 19 | wdt.Configure( 30.0 ); |
klauss | 119:ee6a53069455 | 20 | wdt_timer.start(); |
klauss | 119:ee6a53069455 | 21 | return ( 0 ); |
klauss | 81:3656f00ab3db | 22 | } |
klauss | 74:81c47fff88a5 | 23 | |
klauss | 119:ee6a53069455 | 24 | inline int init_external_wdt() |
klauss | 119:ee6a53069455 | 25 | { |
klauss | 119:ee6a53069455 | 26 | udp_wdt_client.set_blocking( false, 0 ); |
klauss | 119:ee6a53069455 | 27 | return ( udp_wdt_client.bind( 6612 ) ); |
klauss | 119:ee6a53069455 | 28 | } |
klauss | 119:ee6a53069455 | 29 | |
klauss | 119:ee6a53069455 | 30 | inline void reconnect_extern_wdt_socket() |
klauss | 119:ee6a53069455 | 31 | { |
klauss | 119:ee6a53069455 | 32 | udp_wdt_client.close(); |
klauss | 119:ee6a53069455 | 33 | udp_wdt_client.set_blocking( false, 0 ); |
klauss | 119:ee6a53069455 | 34 | udp_wdt_client.bind( 6612 ); |
klauss | 82:f55d13babca0 | 35 | } |
klauss | 82:f55d13babca0 | 36 | |
klauss | 74:81c47fff88a5 | 37 | #endif |