Subversion Repositories HomeAutomation

Rev

Rev 480 | Rev 493 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 480 Rev 490
Line 1... Line 1...
1
/**
1
/**
2
 * CanServo.
2
 * CAN Servo.
3
 * Takes incomming packages and adjusts PWM output.
-
 
-
 
3
 *
4
 * Input: 0 to 255
4
 * Input: 0 to 255
5
 * Position msg: <byte0 BLINDS_CMD> <byte1 position> <byte2 servo number>
5
 * Position msg: <byte0 BLINDS_CMD> <byte1 position> <byte2 servo number>
6
 * Turning msg: <byte0 START/STOP> <byte 1 direction> <byte2 servo number>
6
 * Turning msg: <byte0 START/STOP> <byte 1 direction> <byte2 servo number>
7
 *
7
 *
8
 * @date    2007-01-01
8
 * @date    2007-01-01
9
 * @author  Erik Larsson
9
 * @author  Erik Larsson
10
 *
10
 *
11
 */
11
 */
12
 
12
 
13
//#define TWO_BUTTON_MODE /* If using two (or just one but nothing more) auxiliary buttons */
13
//#define TWO_BUTTON_MODE /* If using two (or just one but nothing more) auxiliary buttons */
14
 
14
 
15
/*-----------------------------------------------------------------------------
15
/*-----------------------------------------------------------------------------
16
 * Includes
16
 * Includes
17
 *---------------------------------------------------------------------------*/
17
 *---------------------------------------------------------------------------*/
18
/* system files */
18
/* system files */
19
#include <avr/io.h>
19
#include <avr/io.h>
20
#include <avr/interrupt.h>
20
#include <avr/interrupt.h>
-
 
21
#include <inttypes.h>
21
#include <stdio.h>
22
#include <stdio.h>
22
/* lib files */
23
/* lib files */
23
#include <bios.h>
24
#include <bios.h>
24
#include <config.h>
25
#include <config.h>
25
#include <drivers/timer/timebase.h>
26
#include <drivers/timer/timebase.h>
26
#include <tc1047.h>
27
#include <tc1047.h>
27
#include <rc_servo.h>
28
#include <rc_servo.h>
28
 
29
 
29
#include <funcdefs.h>
30
//#include <funcdefs.h>
30
 
31
 
31
/* defines */
32
/* defines */
-
 
33
#define SERVOID_1 0xabc
-
 
34
#define SERVOID_2 0xbcd
-
 
35
#define SERVOID_3 0xcde
-
 
36
 
32
#define GROUP_ID    0x01L // FIXME
37
//#define GROUP_ID  0x01L // FIXME
33
 
38
 
34
#define FAILSAFE_MODE       0x0F
39
#define FAILSAFE_MODE       0x0F
35
#define FAILSAFE_TRESHOLD   0x60  /* Degrees celcius when nodeBlinds goes into failsafe mode */
40
#define FAILSAFE_TRESHOLD   50  // Degrees celcius when nodeBlinds goes into failsafe mode
36
 
41
 
37
#define BLINDS_CMD_ABS      0x01 /* Absolute position */
42
#define BLINDS_CMD_ABS      0x01 // Absolute position
38
#define BLINDS_CMD_REL      0x02 /* Relative position */
43
#define BLINDS_CMD_REL      0x02 // Relative position
39
#define BLINDS_CMD_START    0x03 /* Start turning RC-servo */
44
#define BLINDS_CMD_START    0x03 // Start turning RC-servo
40
#define BLINDS_CMD_STOP     0x04 /* Stop turning RC-servo */
45
#define BLINDS_CMD_STOP     0x04 // Stop turning RC-servo
41
#define BLINDS_CMD_RESET    0x05
46
#define BLINDS_CMD_RESET    0x05
42
#define BLINDS_CMD_STATUS   0x06
47
#define BLINDS_CMD_STATUS   0x06
43
 
48
 
44
#define BLINDS_TURN_STOP    0x00
49
#define BLINDS_TURN_STOP    0x00
45
#define BLINDS_TURN_LEFT    0x01
50
#define BLINDS_TURN_LEFT    0x01
46
#define BLINDS_TURN_RIGHT   0x02
51
#define BLINDS_TURN_RIGHT   0x02
47
 
52
 
48
#define STEPS_PER_TURN_PERIOD   10 /* number of steps for each adjustment */
53
#define STEPS_PER_TURN_PERIOD   10 // number of steps for each adjustment
49
#define TURN_PERIOD             100 /* ms */
54
#define TURN_PERIOD             100 // ms
50
#define STATUS_SEND_PERIOD      5000 /* ms */
55
#define STATUS_SEND_PERIOD      5000 // ms
51
#define FAILSAFE_SEND_PERIOD    10000 /* ms */
56
#define FAILSAFE_SEND_PERIOD    10000 // ms
52
#define BOUNCE_TIME             10 /* ms */
57
#define BOUNCE_TIME             10 // ms
53
#define SERVO_FEED_TIME         2000 /* ms */
58
#define SERVO_FEED_TIME         5000 // ms
54
#define BUTTON1                 1
59
#define BUTTON1                 1
55
#define BUTTON2                 2
60
#define BUTTON2                 2
56
 
61
 
57
#define SERVO_FEED_PORT         PORTD
62
#define SERVO_FEED_PORT         PORTD
58
#define SERVO_FEED_DDR          DDRD
63
#define SERVO_FEED_DDR          DDRD
59
#define SERVO_FEED_PIN          PD2
64
#define SERVO_FEED_PIN          PD2
-
 
65
 
-
 
66
#define APP_TYPE    CAN_APPTYPES_SERVO
-
 
67
#define APP_VERSION 0x0001
60
 
68
 
61
 
69
 
62
/*-------------------------------------------------------------------------
70
/*-------------------------------------------------------------------------
63
 * Global variables
71
 * Global variables
64
 * -----------------------------------------------------------------------*/
72
 * -----------------------------------------------------------------------*/
65
/*#if defined(TWO_BUTTON_MODE)
73
/*#if defined(TWO_BUTTON_MODE)
66
Can_Message_t txMsg_Button;
74
Can_Message_t txMsg_Button;
67
#endif*/
75
#endif*/
68
 
76
 
69
uint8_t msg_received = 0;
77
volatile uint8_t rxMsgFull;
70
 
78
 
71
Can_Message_t txMsg;
-
 
72
Can_Message_t rxMsg;
79
volatile Can_Message_t rxMsg;
73
 
80
 
74
/*----------------------------------------------------------------------------
81
/*----------------------------------------------------------------------------
75
 * Functions
82
 * Functions
76
 * -------------------------------------------------------------------------*/
83
 * -------------------------------------------------------------------------*/
77
void blindsFailsafe();
84
void blindsFailsafe();
78
 
85
 
79
/* Takes care about incoming messages and parses them if this node is adressed */
-
 
80
void can_receive(Can_Message_t *msg){
86
void can_receive(Can_Message_t *msg){
81
    uint32_t act;
-
 
82
    uint8_t m, act_type, group, node;
87
// CAN callback function
83
    if( ((msg->Id & CLASS_MASK) >> CLASS_MASK_BITS) == CLASS_ACT ){
-
 
84
        act = (msg->Id & TYPE_MASK) >> TYPE_MASK_BITS;
-
 
85
        act_type = (act & ACT_TYPE_MASK) >> ACT_TYPE_BITS;
-
 
86
        group = (act & ACT_GROUP_MASK) >> ACT_GROUP_BITS;
-
 
87
        node = (act & ACT_NODE_MASK) >> ACT_NODE_BITS;
-
 
88
 
-
 
89
        /* Check if it is command to control this servo */
-
 
90
        if(act_type == ACT_TYPE_SERVO){
-
 
91
            if(group == GROUP_ID || node == NODE_ID){
-
 
92
                for(m=0;m<msg->DataLength;m++){
88
    if(!rxMsgFull){
93
                    rxMsg.Data.bytes[m] = msg->Data.bytes[m];
89
        memcpy((void*)&rxMsg, msg, sizeof(rxMsg));
94
                }
-
 
95
            msg_received = 1;
90
        rxMsgFull = 1;
96
            }
-
 
97
        }
-
 
98
    }
91
    }
99
}
92
}
100
/*----------------------------------------------------------------------------
93
/*----------------------------------------------------------------------------
101
 * Interrupt routines
94
 * Interrupt routines
102
 * -------------------------------------------------------------------------*/
95
 * -------------------------------------------------------------------------*/
Line 148... Line 141...
148
 
141
 
149
/*-----------------------------------------------------------------------------
142
/*-----------------------------------------------------------------------------
150
 * Main Program
143
 * Main Program
151
 *---------------------------------------------------------------------------*/
144
 *---------------------------------------------------------------------------*/
152
int main(void) {
145
int main(void) {
-
 
146
    uint32_t act;
-
 
147
    int8_t m;
153
 
148
 
-
 
149
    uint8_t acttype, temp_id;
-
 
150
    uint16_t servoid;
-
 
151
 
154
    uint8_t //blindsStatus, /* Position (-128 to 127) */
152
    uint8_t //blindsStatus, /* Position (-128 to 127) */
155
            servoToTurn,
153
            servoToTurn,
156
            turnDirection = BLINDS_TURN_STOP; /* Specifies direction to turn or stopped */
154
            turnDirection = BLINDS_TURN_STOP; /* Specifies direction to turn or stopped */
157
    uint32_t boardTemperature = 0;
155
    uint32_t boardTemperature = 0;
158
    uint32_t timeStamp = 0, timeStampTurn = 0, servoFeed_timeStamp = 0;
156
    uint32_t timeStamp = 0, timeStampTurn = 0, servoFeed_timeStamp = 0;
159
 
157
 
-
 
158
    Can_Message_t txMsg;
-
 
159
 
-
 
160
    // Set up callback for CAN messages
-
 
161
    BIOS_CanCallback = &can_receive;
-
 
162
 
160
    sei();
163
    sei();
161
   
164
 
162
    Timebase_Init();
165
    Timebase_Init();
163
    adcTemperatureInit();
166
    adcTemperatureInit();
164
    rcServoInit();
167
    rcServoInit();
165
 
168
 
166
#if defined(TWO_BUTTON_MODE)
169
#if defined(TWO_BUTTON_MODE)
167
    /*
170
    /*
168
     * Initialize buttons
171
     * Initialize buttons
169
     * It is possible to use ie. sensors instead
172
     * It is possible to use ie. sensors instead
170
     * but then change this
173
     * but then change this
Line 180... Line 183...
180
#endif
183
#endif
181
    /* Set output and turn off the servo current feed */
184
    /* Set output and turn off the servo current feed */
182
    SERVO_FEED_DDR |= (1<<SERVO_FEED_PIN);
185
    SERVO_FEED_DDR |= (1<<SERVO_FEED_PIN);
183
    SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
186
    SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
184
 
187
 
-
 
188
    txMsg.Id = (CAN_NMT_APP_START << CAN_SHIFT_NMT_TYPE) | (NODE_ID << CAN_SHIFT_NMT_SID);
185
    txMsg.RemoteFlag = 0;
189
    txMsg.RemoteFlag = 0;
186
    txMsg.ExtendedFlag = 1;
190
    txMsg.ExtendedFlag = 1;
-
 
191
    txMsg.DataLength = 4;
-
 
192
    txMsg.Data.words[0] = APP_TYPE;
-
 
193
    txMsg.Data.words[1] = APP_VERSION;
-
 
194
 
-
 
195
    BIOS_CanSend(&txMsg); // Send startup message
-
 
196
 
187
    txMsg.Id = (CLASS_SNS << CLASS_MASK_BITS)|(SNS_ACT_STATUS_SERVO << TYPE_MASK_BITS)|(NODE_ID << SID_MASK_BITS);
197
    txMsg.Id = 0x08000c0b; //(CLASS_SNS << CLASS_MASK_BITS)|(SNS_ACT_STATUS_SERVO << TYPE_MASK_BITS)|(NODE_ID << SID_MASK_BITS);
-
 
198
 
-
 
199
    // Main loop
-
 
200
    while (1) {
-
 
201
        // check if any messages have been received
-
 
202
        if(rxMsgFull){
-
 
203
            if( ((rxMsg.Id & CAN_MASK_CLASS)>>CAN_SHIFT_CLASS) == CAN_ACT ){
-
 
204
                // Actuator package
-
 
205
                acttype = (uint8_t)((rxMsg.Id & CAN_MASK_ACT_FUNCC) >> CAN_SHIFT_ACT_FUNCC);
-
 
206
                servoid = (uint16_t)((rxMsg.Id & CAN_MASK_ACT_NID) >> CAN_SHIFT_ACT_NID);
-
 
207
 
-
 
208
        // Check if it is command to control this servo
-
 
209
                if(acttype == ACT_FUNCC_SERVO && (servoid == SERVOID_1 || servoid == SERVOID_2 || servoid == SERVOID_3)){
-
 
210
                    // This node that control a servo is adressed
-
 
211
                    if(servoid == SERVOID_1){
-
 
212
                        temp_id = 1; // First servo
-
 
213
                    }else if(servoid == SERVOID_2){
-
 
214
                        temp_id = 2; // and so on
-
 
215
                    }else if(servoid == SERVOID_3){
-
 
216
                        temp_id = 3;
-
 
217
                    }
188
 
218
 
-
 
219
                    if(rxMsg.DataLength == 1 || (rxMsg.DataLength == 2 && rxMsg.Data.bytes[1] == BLINDS_CMD_ABS)){
189
    /* Set up callback for CAN messages */
220
                        // Set absolute position to servo
-
 
221
 
-
 
222
                        setPosition( rxMsg.Data.bytes[0], temp_id );
190
    BIOS_CanCallback = &can_receive;
223
                        servoFeed_timeStamp = Timebase_CurrentTime();
-
 
224
 
-
 
225
                    }else if(rxMsg.DataLength == 2){
-
 
226
                        if(rxMsg.Data.bytes[1] == BLINDS_CMD_REL){
-
 
227
                            // Set relative position to servo
-
 
228
 
-
 
229
                            alterPosition( rxMsg.Data.bytes[0], temp_id );
-
 
230
                            servoFeed_timeStamp = Timebase_CurrentTime();
191
 
231
 
192
    /* main loop */
-
 
193
    while (1) {
-
 
194
        /* check if any messages have been received */
-
 
195
        if(msg_received){
-
 
196
            /* This node that control a servo is adressed */
-
 
197
            if( rxMsg.Data.bytes[0] == BLINDS_CMD_ABS ){
232
                        }else if(rxMsg.Data.bytes[1] == BLINDS_CMD_START ){
198
                /* Set absolute position to servo */
233
                            // Start turning the servo
199
                setPosition( rxMsg.Data.bytes[1], rxMsg.Data.bytes[2] );
-
 
200
                servoFeed_timeStamp = Timebase_CurrentTime();
-
 
201
 
234
 
202
            }else if(rxMsg.Data.bytes[0] == BLINDS_CMD_REL){
235
                            turnDirection = rxMsg.Data.bytes[0]; // FIXME riktning beroende pÃ¥ positivt eller negativt tal?
203
                /* Set relative position to servo */
236
                            servoToTurn = temp_id;
204
                alterPosition( rxMsg.Data.bytes[1], rxMsg.Data.bytes[2] );
-
 
205
                servoFeed_timeStamp = Timebase_CurrentTime();
237
                            servoFeed_timeStamp = Timebase_CurrentTime();
206
 
238
 
207
            }else if(rxMsg.Data.bytes[0] == BLINDS_CMD_START ){
239
                        }else if(rxMsg.Data.bytes[0] == BLINDS_CMD_STOP ){
208
                /* Start turning the servo */
240
                            // Stop turning
209
                turnDirection = rxMsg.Data.bytes[1];
-
 
210
                servoToTurn = rxMsg.Data.bytes[2];
-
 
211
                servoFeed_timeStamp = Timebase_CurrentTime();
-
 
212
 
241
 
213
            }else if(rxMsg.Data.bytes[0] == BLINDS_CMD_STOP ){
-
 
214
                /* Stop turning */
-
 
215
                turnDirection = BLINDS_TURN_STOP;
242
                            turnDirection = BLINDS_TURN_STOP;
216
 
243
 
217
            }else if(rxMsg.Data.bytes[0] == BLINDS_CMD_STATUS){
244
                        }/*else if(rxMsg.Data.bytes[0] == BLINDS_CMD_STATUS){
218
                /* Send blinds status to CAN */
245
                            // Send blinds status to CAN
219
                boardTemperature = getTC1047temperature();
246
                            boardTemperature = getTC1047temperature();
220
 
247
 
221
                if( (int32_t)boardTemperature >= FAILSAFE_TRESHOLD ){
248
                            if( (int32_t)boardTemperature >= FAILSAFE_TRESHOLD ){
222
                    blindsFailsafe();
249
                                blindsFailsafe();
223
                }else{
250
                            }else{
224
                    txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
251
                            txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
225
                    txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
252
                            txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
226
                    txMsg.Data.bytes[2] = 0x00;
253
                            txMsg.Data.bytes[2] = 0x00;
227
#if NUMBER_OF_RCS >0
-
 
228
                    txMsg.Data.bytes[3] = getPosition(1);
254
                            txMsg.Data.bytes[3] = getPosition(1);
229
#endif
-
 
230
#if NUMBER_OF_RCS >1
-
 
231
                    txMsg.Data.bytes[4] = getPosition(2);
255
                            txMsg.Data.bytes[4] = getPosition(2);
232
#endif
-
 
233
#if NUMBER_OF_RCS >2
-
 
234
                    txMsg.Data.bytes[5] = getPosition(3);
256
                            txMsg.Data.bytes[5] = getPosition(3);
235
#endif
-
 
236
                    txMsg.DataLength = NUMBER_OF_RCS+3;
257
                            txMsg.DataLength = 6;
237
                    BIOS_CanSend(&txMsg);
258
                            BIOS_CanSend(&txMsg);
-
 
259
                        }*/
-
 
260
                    }
238
                    }
261
                }
239
                }
262
            }
-
 
263
 
240
                msg_received = 0;
264
            rxMsgFull = 0;
241
        }
265
        }
242
 
266
 
243
        if( (Timebase_CurrentTime() - timeStamp)  >= STATUS_SEND_PERIOD ){
267
        if( (Timebase_CurrentTime() - timeStamp)  >= STATUS_SEND_PERIOD ){
244
            timeStamp = Timebase_CurrentTime();
268
            timeStamp = Timebase_CurrentTime();
245
            /* Send blinds status to CAN */
269
            // Send blinds status to CAN periodically
246
 
270
 
247
            boardTemperature = getTC1047temperature();
271
            boardTemperature = getTC1047temperature();
248
 
272
 
249
            if( (int32_t)boardTemperature >= FAILSAFE_TRESHOLD ){
273
            if( (int32_t)boardTemperature >= FAILSAFE_TRESHOLD ){
250
                blindsFailsafe();
274
                blindsFailsafe();
251
            }else{
275
                }else{
252
                txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
276
                txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
253
                txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
277
                txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
254
                txMsg.Data.bytes[2] = 0x00;
278
                txMsg.Data.bytes[2] = 0x00;
255
#if NUMBER_OF_RCS >0
-
 
256
                txMsg.Data.bytes[3] = getPosition(1);
279
                txMsg.Data.bytes[3] = getPosition(1);
257
#endif
-
 
258
#if NUMBER_OF_RCS >1
-
 
259
                txMsg.Data.bytes[4] = getPosition(2);
280
                txMsg.Data.bytes[4] = getPosition(2);
260
#endif
-
 
261
#if NUMBER_OF_RCS >2
-
 
262
                txMsg.Data.bytes[5] = getPosition(3);
281
                txMsg.Data.bytes[5] = getPosition(3);
263
#endif
-
 
264
                txMsg.DataLength = NUMBER_OF_RCS+3;
282
                txMsg.DataLength = 6;
265
 
283
 
266
                BIOS_CanSend(&txMsg);
284
                BIOS_CanSend(&txMsg);
267
            }
285
            }
268
        }
286
        }
269
        /* If start turning servo */
287
        // If start turning servo
270
        if( turnDirection ){
288
/*      if( turnDirection ){
271
            if( Timebase_CurrentTime() - timeStampTurn >= TURN_PERIOD ){
289
            if( Timebase_CurrentTime() - timeStampTurn >= TURN_PERIOD ){
272
                timeStampTurn = Timebase_CurrentTime();
290
                timeStampTurn = Timebase_CurrentTime();
273
                /* Clockwise or counterclockwise? */
291
                // Clockwise or counterclockwise?
274
                if( turnDirection == BLINDS_TURN_LEFT ){
292
                if( turnDirection == BLINDS_TURN_LEFT ){
275
                    alterPosition( -STEPS_PER_TURN_PERIOD , servoToTurn);
293
                    alterPosition( -STEPS_PER_TURN_PERIOD , servoToTurn);
276
                }else if( turnDirection == BLINDS_TURN_RIGHT ){
294
                }else if( turnDirection == BLINDS_TURN_RIGHT ){
277
                    alterPosition( STEPS_PER_TURN_PERIOD , servoToTurn);
295
                    alterPosition( STEPS_PER_TURN_PERIOD , servoToTurn);
278
                }
296
                }
279
            }
297
            }
280
        }
298
        }
281
        /* Turn off the servo current feed */
299
        // Turn off the servo current feed
282
        if( Timebase_CurrentTime() - servoFeed_timeStamp >= SERVO_FEED_TIME ){
300
        if( Timebase_CurrentTime() - servoFeed_timeStamp >= SERVO_FEED_TIME ){
283
            SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
301
            SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
-
 
302
            servoDisable();
284
        }else{
303
        }else{
285
            SERVO_FEED_PORT |= (1<<SERVO_FEED_PIN);
304
            SERVO_FEED_PORT |= (1<<SERVO_FEED_PIN);
-
 
305
            servoEnable();
286
        }
306
        }*/
287
    }
307
    }
288
    return 0;
308
    return 0;
289
}
309
}
290
 
310
 
291
void blindsFailsafe()
311
void blindsFailsafe()
292
{
312
{
293
    uint32_t boardTemperature = 0, timeStamp = 0;
313
/*  uint32_t boardTemperature = 0, timeStamp = 0;
294
 
314
 
295
    /* Turn of servo current feed */
315
    // Turn of servo current feed
296
    SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
316
    SERVO_FEED_PORT &= ~(1<<SERVO_FEED_PIN);
297
 
317
 
298
 
318
 
299
    while(1){
319
    while(1){
300
        /* check if any messages have been received */
320
        // check if any messages have been received
301
        while(msg_received) {
321
        while(rxMsgFull) {
302
            /* This relay is adressed*/
322
            // This relay is adressed
303
            if(rxMsg.Data.bytes[0] == BLINDS_CMD_RESET ){
323
            if(rxMsg.Data.bytes[0] == BLINDS_CMD_RESET ){
304
                /* Return from failsafe mode */
324
                // Return from failsafe mode
305
                return;
325
                return;
306
            }
326
            }
307
        }
327
        }
308
 
328
 
309
        if( Timebase_CurrentTime() - timeStamp >= FAILSAFE_SEND_PERIOD ){
329
        if( Timebase_CurrentTime() - timeStamp >= FAILSAFE_SEND_PERIOD ){
310
            timeStamp = Timebase_CurrentTime();
330
            timeStamp = Timebase_CurrentTime();
311
            /* Send relay status to CAN */
331
            // Send relay status to CAN
312
            boardTemperature = getTC1047temperature();
332
            boardTemperature = getTC1047temperature();
313
 
333
 
314
            txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
334
            txMsg.Data.bytes[0] = boardTemperature & 0x00FF;
315
            txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
335
            txMsg.Data.bytes[1] = (boardTemperature & 0xFF00)>>8;
316
            txMsg.Data.bytes[2] = FAILSAFE_MODE;
336
            txMsg.Data.bytes[2] = FAILSAFE_MODE;
Line 325... Line 345...
325
#endif
345
#endif
326
            txMsg.DataLength = NUMBER_OF_RCS+3;
346
            txMsg.DataLength = NUMBER_OF_RCS+3;
327
 
347
 
328
            BIOS_CanSend(&txMsg);
348
            BIOS_CanSend(&txMsg);
329
        }
349
        }
330
    }
350
    }*/
331
}
351
}
332
 
352