Subversion Repositories HomeAutomation

Rev

Rev 527 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 527 Rev 528
Line 123... Line 123...
123
                    txMsg.Data.words[1] = getRawData(index+1);
123
                    txMsg.Data.words[1] = getRawData(index+1);
124
                    txMsg.Data.words[2] = getRawData(index+2);
124
                    txMsg.Data.words[2] = getRawData(index+2);
125
                    txMsg.Data.words[3] = getRawData(index+3);
125
                    txMsg.Data.words[3] = getRawData(index+3);
126
                   
126
                   
127
                    /* buffers will be filled when sending more than 2-3 messages, so retry until sent */
127
                    /* buffers will be filled when sending more than 2-3 messages, so retry until sent */
128
                    while (BIOS_CanSend(&txMsg) != CAN_OK) {}
128
                    //while (BIOS_CanSend(&txMsg) != CAN_OK) {}
-
 
129
                    BIOS_CanSend(&txMsg);
-
 
130
                   
-
 
131
                    uint16_t dummycnt = 1;
-
 
132
                    while (dummycnt > 0) {
-
 
133
                        dummycnt++;
-
 
134
                        asm("nop");
-
 
135
                        asm("nop");
-
 
136
                    }
129
                }
137
                }
130
               
138
               
131
                uint8_t lastpacketcnt = datacnt&0x03;
139
                uint8_t lastpacketcnt = datacnt&0x03;
132
                if (lastpacketcnt > 0) {
140
                if (lastpacketcnt > 0) {
133
                    txMsg.DataLength = lastpacketcnt<<1;
141
                    txMsg.DataLength = lastpacketcnt<<1;
134
                    for (uint8_t i = 0; i < lastpacketcnt; i++) {
142
                    for (uint8_t i = 0; i < lastpacketcnt; i++) {
135
                        txMsg.Data.words[i] = getRawData((datacnt&0xfc)|i);
143
                        txMsg.Data.words[i] = getRawData((datacnt&0xfc)|i);
136
                    }
144
                    }
-
 
145
                    /* buffers will be filled when sending more than 2-3 messages, so retry until sent */
-
 
146
                    //while (BIOS_CanSend(&txMsg) != CAN_OK) {}
137
                    BIOS_CanSend(&txMsg);
147
                    BIOS_CanSend(&txMsg);
138
                }
148
                }
139
 
149
 
140
                irTimeoutTime = Timebase_CurrentTime();
150
                irTimeoutTime = Timebase_CurrentTime();
141
                state = STATE_IR_REPEAT;
151
                state = STATE_IR_REPEAT;