Revision 191 trunk/common/tooltron.h

tooltron.h (revision 191)
43 43
#define PROGM_PACKET_SIZE 2
44 44
#define PROGD_PACKET_SIZE 32
45 45

  
46
// Packet handler states
47
typedef enum {
48
    sd,         // Looking for start delimiter
49
    src,        // Looking for source
50
    dest,       // Looking for destination
51
    comd,       // Looking for command
52
    read,       // Reading payload
53
    cs         // Calculate checksum
54
} state_t;
55

  
56 46
// Tool timeout?
57 47
#define TIMEOUT_SECONDS 10 
58 48

  
......
63 53
/****** Utility Definitions ******/
64 54
#define TRUE  0
65 55
#define FALSE 1
66

  
67
/****** Jump Table ******/
68
// Jump table addresses
69
// If the bootloader changes, you must change the jump table addresses!
70
#define JT_INIT_UART        0x0
71
#define JT_UART_GET_BYTE    0x0
72
#define JT_UART_SEND_BYTE   0x0
73
#define JT_PARSE_PACKET     0x0
74
#define JT_SEND_PACKET      0x0
75

  
76

  
77
// Jump table functions for locations that are in the bootloader
78
#ifdef TOOLBOX
79
void (*uart_init)(uint16_t baud) = JT_UART_INIT;
80
int8_t (*uart_get_byte)(uint8_t *output_byte) = JT_UART_GET_BYTE;
81
void (*uart_send_byte)(uint8_t data) = JT_UART_SEND_BYTE;
82
void (*uart_toggle_transmit)(uint8_t state) = JT_UART_TOGGLE_TRANSMIT;
83
char (*parse_packet)(uint8_t *mbuf) = JT_PARSE_PACKET;
84
void (*send_packet)(uint8_t cmd) = JT_SEND_PACKET;
85 56
#endif
86

  
87

  
88
#endif

Also available in: Unified diff