VZTECH / Mbed 2 deprecated main_src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers bootloader.h Source File

bootloader.h

00001 #ifndef __BOOTLOADER_H__
00002 #define __BOOTLOADER_H__
00003 
00004 #include <stdint.h>
00005 #include "call_box.h"
00006 #include "EthernetInterface.h"
00007 
00008 const uint16_t BL_PORT = 3000;
00009 const uint16_t BL_SIZE = 260;
00010 const uint16_t UDP_BL_SIZE = 262;
00011 
00012 extern Timer udp_bl_timer;
00013 extern Endpoint udp_bl_server;
00014 extern UDPSocket udp_bl_client;
00015 extern char bl_recv_buffer[ UDP_BL_SIZE ],bl_send_buffer[ UDP_BL_SIZE  ],bl_cbx_buffer[ BL_SIZE + 1 ];
00016 extern uint16_t bl_peer,bl_port;
00017 extern uint8_t bl_start_flag,bl_ts,next_pkg_ts0;
00018 extern Call_Box * bl_cb;
00019 extern uint8_t *bl_write_buffer;
00020 
00021 inline int init_bl ( void )
00022 {
00023   udp_bl_client.bind ( BL_PORT );
00024   udp_bl_client.set_blocking ( false, 0 );
00025   return ( 0 );
00026 }
00027 
00028 inline int end_bl ( void )
00029 {
00030   udp_bl_client.close ();
00031   
00032   return ( 0 );
00033 }
00034 
00035 inline int reconnect_bl ( void )
00036 {
00037     end_bl ();
00038     init_bl ();
00039     
00040     return ( 0 );
00041 }
00042 
00043 #endif