Project

General

Profile

Revision 793

Updated bay board wireless library... Doesn't work at all.

View differences:

wireless.h
40 40
/**
41 41
 * The maximum number of packet groups.
42 42
 **/
43
#define WL_MAX_PACKET_GROUPS 4
43
//TODO: a PacketGroupHandler is at least 10 bytes (I don't know if function pointers are 2 bytes
44
// or 4 bytes).  That means that in the c file, your array of packet groups is at least 160 bytes.
45
// Normally that might be fine (the robot's avr chips have 4k SRAM), but austin's chip only has
46
// 1k SRAM, so if this number can be reduced or if the size of the struct could be reduced, that would be a plus.
47
#define WL_MAX_PACKET_GROUPS 16
44 48

  
45 49
/**
46 50
 * @defgroup wireless Wireless
......
72 76
 * handlers for various events which can occur related to a packet
73 77
 * group.
74 78
 **/
79
//TODO: the order of member variables in this struct should be changed in case the compile packs the struct
80
// In order to achieve the best packing, the variables should be listed in order of decreasing memory size.
81
// Thus, pointers should be first, followed by int, followed by char.
75 82
typedef struct
76 83
{
77 84
	/**
85
	 * The group code for this packet group. This number
86
	 * must be unique. The maximum number of packet groups
87
	 * is defined by WL_MAX_PACKET_GROUPS.
88
	 **/
89
  //TODO: if this number must be less than or equal to WL_MAX_PACKET_GROUPS, don't you only need
90
  // one byte for it and it can be made an unsigned char?
91
	unsigned int groupCode;
92

  
93
	/**
78 94
	 * Called every half second (not in interrupt,
79 95
	 * but in wl_do).
80 96
	 **/
......
107 123
	 **/
108 124
	void (*unregister) (void);
109 125

  
110
	/**
111
	 * The group code for this packet group. This number
112
	 * must be unique. The maximum number of packet groups
113
	 * is defined by WL_MAX_PACKET_GROUPS.
114
	 **/
115
	unsigned int groupCode;
116

  
117 126
} PacketGroupHandler;
118 127

  
119 128
/**@brief Initialize the wireless library **/

Also available in: Unified diff