Rev 847 | Rev 852 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 847 | Rev 851 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | 1 | ||
| 2 | #include "template.h" |
2 | #include "<template>.h" |
| 3 | 3 | ||
| 4 | void |
4 | void <template>_Init(void) |
| 5 | { |
5 | { |
| 6 | ///TODO: Initialize hardware etc here |
6 | ///TODO: Initialize hardware etc here |
| 7 | } |
7 | } |
| 8 | 8 | ||
| 9 | void |
9 | void <template>_Process(void) |
| 10 | { |
10 | { |
| 11 | ///TODO: Stuff that needs doing is done here |
11 | ///TODO: Stuff that needs doing is done here |
| 12 | } |
12 | } |
| 13 | 13 | ||
| 14 | void |
14 | void <template>_HandleMessage(StdCan_Msg_t *rxMsg) |
| 15 | { |
15 | { |
| 16 | StdCan_Msg_t txMsg; |
16 | StdCan_Msg_t txMsg; |
| 17 | uint8_t n = 0; |
17 | uint8_t n = 0; |
| 18 | 18 | ||
| 19 | if ( StdCan_Ret_class(rxMsg->Header) == |
19 | if ( StdCan_Ret_class(rxMsg->Header) == CAN_CLASS_MODULE_<template> && ///TODO: Change this to the actual class type |
| 20 | StdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER && |
20 | StdCan_Ret_direction(rxMsg->Header) == DIR_TO_OWNER && |
| 21 | rxMsg->Header.ModuleType == |
21 | rxMsg->Header.ModuleType == CAN_TYPE_MODULE_<template> && ///TODO: Change this to the actual module type |
| 22 | rxMsg->Header.ModuleId == |
22 | rxMsg->Header.ModuleId == <template>_ID) |
| 23 | { |
23 | { |
| 24 | switch (rxMsg->Header.Command) |
24 | switch (rxMsg->Header.Command) |
| 25 | { |
25 | { |
| 26 | case CAN_CMD_MODULE_DUMMY: |
26 | case CAN_CMD_MODULE_DUMMY: |
| 27 | ///TODO: Do something dummy |
27 | ///TODO: Do something dummy |
| 28 | break; |
28 | break; |
| 29 | } |
29 | } |
| 30 | } |
30 | } |
| 31 | } |
31 | } |
| 32 | 32 | ||
| 33 | void |
33 | void <template>_List(uint8_t ModuleSequenceNumber) |
| 34 | { |
34 | { |
| 35 | StdCan_Msg_t txMsg; |
35 | StdCan_Msg_t txMsg; |
| 36 | 36 | ||
| 37 | StdCan_Set_class(txMsg.Header, |
37 | StdCan_Set_class(txMsg.Header, CAN_CLASS_MODULE_<template>); ///TODO: Change this to the actual class type |
| 38 | StdCan_Set_direction(txMsg.Header, DIR_FROM_OWNER); |
38 | StdCan_Set_direction(txMsg.Header, DIR_FROM_OWNER); |
| 39 | txMsg.Header.ModuleType = |
39 | txMsg.Header.ModuleType = CAN_TYPE_MODULE_<template>; ///TODO: Change this to the actual module type |
| 40 | txMsg.Header.ModuleId = |
40 | txMsg.Header.ModuleId = <template>_ID; |
| 41 | txMsg.Header.Command = CAN_CMD_MODULE_NMT_LIST; |
41 | txMsg.Header.Command = CAN_CMD_MODULE_NMT_LIST; |
| 42 | txMsg.Length = 6; |
42 | txMsg.Length = 6; |
| 43 | 43 | ||
| 44 | txMsg.Data[0] = NODE_HW_ID_BYTE0; |
44 | txMsg.Data[0] = NODE_HW_ID_BYTE0; |
| 45 | txMsg.Data[1] = NODE_HW_ID_BYTE1; |
45 | txMsg.Data[1] = NODE_HW_ID_BYTE1; |