Rev 942 | Rev 967 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 942 | Rev 954 | ||
|---|---|---|---|
| Line 68... | Line 68... | ||
| 68 | 68 | ||
| 69 | } |
69 | } |
| 70 | 70 | ||
| 71 | void sendADCvalue(uint8_t timer) { |
71 | void sendADCvalue(uint8_t timer) { |
| 72 | StdCan_Msg_t txMsg; |
72 | StdCan_Msg_t txMsg; |
| 73 | StdCan_Set_class(txMsg.Header, |
73 | StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_ACT); |
| 74 | StdCan_Set_direction(txMsg.Header, |
74 | StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER); |
| 75 | txMsg.Header.ModuleType = |
75 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_RGBDRIVER; |
| 76 | txMsg.Header.ModuleId = act_RGBdriver_ID; |
76 | txMsg.Header.ModuleId = act_RGBdriver_ID; |
| 77 | txMsg.Header.Command = |
77 | txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_DEBUG; |
| 78 | txMsg.Length = 6; |
78 | txMsg.Length = 6; |
| 79 | 79 | ||
| 80 | //txMsg.Data[0] = (uint8_t)(ADC_Get(5)>>2); |
80 | //txMsg.Data[0] = (uint8_t)(ADC_Get(5)>>2); |
| 81 | txMsg.Data[0] = (uint8_t)(ADC_Get(5)&0xff); |
81 | txMsg.Data[0] = (uint8_t)(ADC_Get(5)&0xff); |
| 82 | txMsg.Data[1] = 0; |
82 | txMsg.Data[1] = 0; |
| Line 136... | Line 136... | ||
| 136 | ///TODO: Stuff that needs doing is done here |
136 | ///TODO: Stuff that needs doing is done here |
| 137 | } |
137 | } |
| 138 | 138 | ||
| 139 | void act_RGBdriver_HandleMessage(StdCan_Msg_t *rxMsg) |
139 | void act_RGBdriver_HandleMessage(StdCan_Msg_t *rxMsg) |
| 140 | { |
140 | { |
| 141 | if ( StdCan_Ret_class(rxMsg->Header) == |
141 | if ( StdCan_Ret_class(rxMsg->Header) == CAN_MODULE_CLASS_ACT && |
| 142 | StdCan_Ret_direction(rxMsg->Header) == |
142 | StdCan_Ret_direction(rxMsg->Header) == DIRECTIONFLAG_TO_OWNER && |
| 143 | rxMsg->Header.ModuleType == |
143 | rxMsg->Header.ModuleType == CAN_MODULE_TYPE_ACT_RGBDRIVER && |
| 144 | rxMsg->Header.ModuleId == act_RGBdriver_ID) |
144 | rxMsg->Header.ModuleId == act_RGBdriver_ID) |
| 145 | { |
145 | { |
| 146 | switch (rxMsg->Header.Command) |
146 | switch (rxMsg->Header.Command) |
| 147 | { |
147 | { |
| 148 | case 0: |
148 | case 0: |
| Line 154... | Line 154... | ||
| 154 | 154 | ||
| 155 | void act_RGBdriver_List(uint8_t ModuleSequenceNumber) |
155 | void act_RGBdriver_List(uint8_t ModuleSequenceNumber) |
| 156 | { |
156 | { |
| 157 | StdCan_Msg_t txMsg; |
157 | StdCan_Msg_t txMsg; |
| 158 | 158 | ||
| 159 | StdCan_Set_class(txMsg.Header, |
159 | StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_ACT); |
| 160 | StdCan_Set_direction(txMsg.Header, |
160 | StdCan_Set_direction(txMsg.Header, DIRECTIONFLAG_FROM_OWNER); |
| 161 | txMsg.Header.ModuleType = |
161 | txMsg.Header.ModuleType = CAN_MODULE_TYPE_ACT_RGBDRIVER; |
| 162 | txMsg.Header.ModuleId = act_RGBdriver_ID; |
162 | txMsg.Header.ModuleId = act_RGBdriver_ID; |
| 163 | txMsg.Header.Command = |
163 | txMsg.Header.Command = CAN_MODULE_CMD_GLOBAL_LIST; |
| 164 | txMsg.Length = 6; |
164 | txMsg.Length = 6; |
| 165 | 165 | ||
| 166 | txMsg.Data[0] = NODE_HW_ID_BYTE0; |
166 | txMsg.Data[0] = NODE_HW_ID_BYTE0; |
| 167 | txMsg.Data[1] = NODE_HW_ID_BYTE1; |
167 | txMsg.Data[1] = NODE_HW_ID_BYTE1; |
| 168 | txMsg.Data[2] = NODE_HW_ID_BYTE2; |
168 | txMsg.Data[2] = NODE_HW_ID_BYTE2; |