Rev 1047 | Rev 1910 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1047 | Rev 1320 | ||
|---|---|---|---|
| Line 31... | Line 31... | ||
| 31 | irTxMsg.Data[6] = (buffer[index+3]>>8)&0xff; |
31 | irTxMsg.Data[6] = (buffer[index+3]>>8)&0xff; |
| 32 | irTxMsg.Data[7] = (buffer[index+3]>>0)&0xff; |
32 | irTxMsg.Data[7] = (buffer[index+3]>>0)&0xff; |
| 33 | 33 | ||
| 34 | /* buffers will be filled when sending more than 2-3 messages, so retry until sent */ |
34 | /* buffers will be filled when sending more than 2-3 messages, so retry until sent */ |
| 35 | while (StdCan_Put(&irTxMsg) != StdCan_Ret_OK) {} |
35 | while (StdCan_Put(&irTxMsg) != StdCan_Ret_OK) {} |
| - | 36 | _delay_ms(1); |
|
| 36 | } |
37 | } |
| 37 | 38 | ||
| 38 | uint8_t lastpacketcnt = len&0x03; |
39 | uint8_t lastpacketcnt = len&0x03; |
| 39 | if (lastpacketcnt > 0) { |
40 | if (lastpacketcnt > 0) { |
| 40 | irTxMsg.Length = lastpacketcnt<<1; |
41 | irTxMsg.Length = lastpacketcnt<<1; |
| Line 42... | Line 43... | ||
| 42 | irTxMsg.Data[i<<1] = (buffer[(len&0xfc)|i]>>8)&0xff; |
43 | irTxMsg.Data[i<<1] = (buffer[(len&0xfc)|i]>>8)&0xff; |
| 43 | irTxMsg.Data[(i<<1)+1] = (buffer[(len&0xfc)|i]>>0)&0xff; |
44 | irTxMsg.Data[(i<<1)+1] = (buffer[(len&0xfc)|i]>>0)&0xff; |
| 44 | } |
45 | } |
| 45 | /* buffers will be filled when sending more than 2-3 messages, so retry until sent */ |
46 | /* buffers will be filled when sending more than 2-3 messages, so retry until sent */ |
| 46 | while (StdCan_Put(&irTxMsg) != StdCan_Ret_OK) {} |
47 | while (StdCan_Put(&irTxMsg) != StdCan_Ret_OK) {} |
| - | 48 | _delay_ms(1); |
|
| 47 | } |
49 | } |
| 48 | 50 | ||
| 49 | } |
51 | } |
| 50 | #endif |
52 | #endif |
| 51 | 53 | ||