Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed
#include "template.h"void template_Init(void){///TODO: Initialize hardware etc here}void template_Process(void){///TODO: Stuff that needs doing is done here}void template_HandleMessage(StdCan_Msg_t *rxMsg){StdCan_Msg_t txMsg;uint8_t n = 0;if ( StdCan_Ret_class(rxMsg->Header) == CAN_CLASS_MODULE_TEMPLATE && ///TODO: Change this to the actual class typeStdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER &&rxMsg->Header.ModuleType == CAN_TYPE_MODULE_TEMPLATE && ///TODO: Change this to the actual module typerxMsg->Header.ModuleId == template_ID){switch (rxMsg->Header.Command){case CAN_CMD_MODULE_DUMMY:///TODO: Do something dummybreak;}}}void template_List(uint8_t ModuleSequenceNumber){StdCan_Msg_t txMsg;StdCan_Set_class(txMsg.Header, CAN_CLASS_MODULE_TEMPLATE); ///TODO: Change this to the actual class typeStdCan_Set_direction(txMsg.Header, DIR_FROM_OWNER);txMsg.Header.ModuleType = CAN_TYPE_MODULE_TEMPLATE; ///TODO: Change this to the actual module typetxMsg.Header.ModuleId = template_ID;txMsg.Header.Command = CAN_CMD_MODULE_NMT_LIST;txMsg.Length = 6;txMsg.Data[0] = NODE_HW_ID_BYTE0;txMsg.Data[1] = NODE_HW_ID_BYTE1;txMsg.Data[2] = NODE_HW_ID_BYTE2;txMsg.Data[3] = NODE_HW_ID_BYTE3;txMsg.Data[4] = NUMBER_OF_MODULES;txMsg.Data[5] = ModuleSequenceNumber;StdCan_Put(&txMsg);}