Project

General

Profile

Revision 201

Added by Kevin Woo almost 13 years ago

  • Setup bootloader to initialize pins to a known safe state
  • Pulled pindefs for the toolbox out of the toolbox into common/toolbox_pindefs.h
  • Shared toolbox pindefs with the bootloader
  • Replaced all raw pin names with the #defined names
  • Optimizied out some bytes out of the bootloader by sharing variables

View differences:

tooltron.h
25 25
// Commonly used message bytes
26 26
#define DELIM      '^'
27 27
#define SERVER     1
28
#define ACK_CRC    ADDR ^ SERVER
29 28

  
30 29
// These are the bytes used in the messaage types
31
#define TT_GET_KEY 'k'      // Get a key from the keyboard
32
#define TT_ACK     'a'      // Ack
33
#define TT_NACK    'n'      // Nack
34
#define TT_TO      'f'      // State timeout
35
#define TT_TIMEOUT 't'      // Packet timeout
36
#define TT_RESET   'r'      // Tool reset request
37
#define TT_BOOT    'b'      // Tool boot message
38
#define TT_PROGM   'p'      // Program mode request
39
#define TT_PROGD   'd'      // Program data
40
#define TT_BAD     0        // If there was a packet parsing error
30
#define TT_GET_KEY  'k'     // Get a key from the keyboard
31
#define TT_ACK      'a'     // Ack
32
#define TT_NACK     'n'     // Nack
33
#define TT_TON      'o'     // Turn the tool on
34
#define TT_TO       'f'     // State timeout
35
#define TT_TIMEOUT  't'     // Packet timeout
36
#define TT_RESET    'r'     // Tool reset request
37
#define TT_BOOT     'b'     // Tool boot message
38
#define TT_PROGM    'p'     // Program mode request
39
#define TT_PROGD    'd'     // Program data
40
#define TT_BAD       0      // If there was a packet parsing error
41 41

  
42 42
// Number of bytes that the PROGx packets have in the payload
43 43
#define PROGM_PACKET_SIZE 2
......
49 49
// Memory locations
50 50
#define MAIN_ADDR 0x0       // User code starts here
51 51
#define BOOT_START 0x400    // Bootloader code starts here
52
#define EEPROM_ADDR 1       // Location of the node's address in the EEPROM
52 53

  
53 54
/****** Utility Definitions ******/
54
#define TRUE  0
55
#define FALSE 1
55
#define TRUE    0x00
56
#define FALSE   0x01
57
#define ON      0x01
58
#define OFF     0x00
56 59
#endif

Also available in: Unified diff