Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
bootloader.h@137:32dd35a6dbc9, 2015-11-24 (annotated)
- Committer:
- klauss
- Date:
- Tue Nov 24 14:06:22 2015 +0000
- Revision:
- 137:32dd35a6dbc9
- Parent:
- 132:05cd37f7e007
core source of the .bin (09/21/2015) in the field
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 117:e9facba9db27 | 1 | #ifndef __BOOTLOADER_H__ |
klauss | 117:e9facba9db27 | 2 | #define __BOOTLOADER_H__ |
klauss | 117:e9facba9db27 | 3 | |
klauss | 121:ee02790d00b7 | 4 | #include <stdint.h> |
klauss | 117:e9facba9db27 | 5 | #include "call_box.h" |
klauss | 121:ee02790d00b7 | 6 | #include "EthernetInterface.h" |
klauss | 117:e9facba9db27 | 7 | |
klauss | 121:ee02790d00b7 | 8 | const uint16_t BL_PORT = 3000; |
klauss | 121:ee02790d00b7 | 9 | const uint16_t BL_SIZE = 260; |
klauss | 121:ee02790d00b7 | 10 | const uint16_t UDP_BL_SIZE = 262; |
klauss | 117:e9facba9db27 | 11 | |
klauss | 117:e9facba9db27 | 12 | extern Timer udp_bl_timer; |
klauss | 117:e9facba9db27 | 13 | extern Endpoint udp_bl_server; |
klauss | 117:e9facba9db27 | 14 | extern UDPSocket udp_bl_client; |
klauss | 117:e9facba9db27 | 15 | extern char bl_recv_buffer[ UDP_BL_SIZE ],bl_send_buffer[ UDP_BL_SIZE ],bl_cbx_buffer[ BL_SIZE + 1 ]; |
klauss | 117:e9facba9db27 | 16 | extern uint16_t bl_peer,bl_port; |
klauss | 117:e9facba9db27 | 17 | extern uint8_t bl_start_flag,bl_ts,next_pkg_ts0; |
klauss | 117:e9facba9db27 | 18 | extern Call_Box * bl_cb; |
klauss | 117:e9facba9db27 | 19 | extern uint8_t *bl_write_buffer; |
klauss | 117:e9facba9db27 | 20 | |
klauss | 132:05cd37f7e007 | 21 | inline int init_bl ( void ) |
klauss | 132:05cd37f7e007 | 22 | { |
klauss | 132:05cd37f7e007 | 23 | udp_bl_client.bind ( BL_PORT ); |
klauss | 132:05cd37f7e007 | 24 | udp_bl_client.set_blocking ( false, 0 ); |
klauss | 119:ee6a53069455 | 25 | return ( 0 ); |
klauss | 117:e9facba9db27 | 26 | } |
klauss | 117:e9facba9db27 | 27 | |
klauss | 132:05cd37f7e007 | 28 | inline int end_bl ( void ) |
klauss | 132:05cd37f7e007 | 29 | { |
klauss | 132:05cd37f7e007 | 30 | udp_bl_client.close (); |
klauss | 132:05cd37f7e007 | 31 | |
klauss | 132:05cd37f7e007 | 32 | return ( 0 ); |
klauss | 132:05cd37f7e007 | 33 | } |
klauss | 132:05cd37f7e007 | 34 | |
klauss | 132:05cd37f7e007 | 35 | inline int reconnect_bl ( void ) |
klauss | 132:05cd37f7e007 | 36 | { |
klauss | 132:05cd37f7e007 | 37 | end_bl (); |
klauss | 132:05cd37f7e007 | 38 | init_bl (); |
klauss | 132:05cd37f7e007 | 39 | |
klauss | 132:05cd37f7e007 | 40 | return ( 0 ); |
klauss | 132:05cd37f7e007 | 41 | } |
klauss | 132:05cd37f7e007 | 42 | |
klauss | 117:e9facba9db27 | 43 | #endif |