equal
deleted
inserted
replaced
1 |
1 |
2 #include "canfestival.h" |
2 #include "canfestival.h" |
|
3 #include "dcf.h" |
3 |
4 |
4 /* CanFestival nodes generated OD headers*/ |
5 /* CanFestival nodes generated OD headers*/ |
5 %(nodes_includes)s |
6 %(nodes_includes)s |
6 |
7 |
7 #define BOARD_DECL(nodename, busname, baudrate)\ |
8 #define BOARD_DECL(nodename, busname, baudrate)\ |
12 |
13 |
13 /* Keep track of init level to cleanup correctly */ |
14 /* Keep track of init level to cleanup correctly */ |
14 static int init_level=0; |
15 static int init_level=0; |
15 /* Retrieve PLC cycle time */ |
16 /* Retrieve PLC cycle time */ |
16 extern int common_ticktime__; |
17 extern int common_ticktime__; |
17 |
|
18 /* Called once all NetworkEdit declares slaves have booted*/ |
|
19 static void Master_post_SlaveBootup(CO_Data* d, UNS8 nodeId) |
|
20 { |
|
21 /* Put the master in operational mode */ |
|
22 setState(d, Operational); |
|
23 |
|
24 /* Ask slave node to go in operational mode */ |
|
25 masterSendNMTstateChange (d, 0, NMT_Start_Node); |
|
26 } |
|
27 |
18 |
28 /* Per master node slavebootup callbacks. Checks that |
19 /* Per master node slavebootup callbacks. Checks that |
29 * every node have booted before calling Master_post_SlaveBootup */ |
20 * every node have booted before calling Master_post_SlaveBootup */ |
30 %(slavebootups)s |
21 %(slavebootups)s |
31 |
22 |
124 init_level++; |
115 init_level++; |
125 return 0; |
116 return 0; |
126 } |
117 } |
127 |
118 |
128 #define NODE_SEND_SYNC(nodename)\ |
119 #define NODE_SEND_SYNC(nodename)\ |
129 sendSYNCMessage(&nodename##_Data); |
120 if(getState(&nodename##_Data)==Operational){\ |
|
121 sendSYNCMessage(&nodename##_Data);\ |
|
122 } |
130 |
123 |
131 void __retrieve_%(locstr)s(void) |
124 void __retrieve_%(locstr)s(void) |
132 { |
125 { |
133 /* Locks the stack, so that no changes occurs while PLC access variables |
126 /* Locks the stack, so that no changes occurs while PLC access variables |
134 * TODO : implement buffers to avoid such a big lock |
127 * TODO : implement buffers to avoid such a big lock |