root / trunk / toolbox / jumptable.h @ 210
History | View | Annotate | Download (793 Bytes)
1 | 191 | kwoo | #ifndef _JUMPTABLE_
|
---|---|---|---|
2 | #define _JUMPTABLE_
|
||
3 | |||
4 | // Jump table addresses
|
||
5 | // If the bootloader changes, you must change the jump table addresses!
|
||
6 | 210 | bneuman | #define JT_ADDR 0x7C0 |
7 | 191 | kwoo | #define JT_RS485_INIT ((void*)((JT_ADDR+0) / 2)) |
8 | 192 | kwoo | #define JT_RS485_GET_BYTE ((void*)((JT_ADDR+2)/2)) |
9 | #define JT_RS485_SEND_BYTE ((void*)((JT_ADDR+4)/2)) |
||
10 | #define JT_PARSE_PACKET ((void*)((JT_ADDR+6)/2)) |
||
11 | #define JT_SEND_PACKET ((void*)((JT_ADDR+8)/2)) |
||
12 | 191 | kwoo | |
13 | #define JT_TYPE static __inline__ void |
||
14 | typedef void (*PF_ARG1)(uint8_t); |
||
15 | |||
16 | void (*rs485_init)(uint16_t) = JT_RS485_INIT;
|
||
17 | int8_t (*rs485_get_byte)(uint8_t*) = JT_RS485_GET_BYTE; |
||
18 | void (*rs485_send_byte)(uint8_t) = JT_RS485_SEND_BYTE;
|
||
19 | 202 | kwoo | char (*parse_packet)(uint8_t*, uint8_t) = JT_PARSE_PACKET;
|
20 | void (*send_packet)(uint8_t, uint8_t) = JT_SEND_PACKET;
|
||
21 | 191 | kwoo | |
22 | #endif |