Subversion Repositories HomeAutomation

Rev

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

Rev 1978 Rev 2032
Line 39... Line 39...
39
void chn_ChnMaster_UpdateChannel( uint16_t channel_id, uint16_t value ) {
39
void chn_ChnMaster_UpdateChannel( uint16_t channel_id, uint16_t value ) {
40
    StdCan_Msg_t txMsg;
40
    StdCan_Msg_t txMsg;
41
    txMsg.Id = 0;
41
    txMsg.Id = 0;
42
    StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_CHN);
42
    StdCan_Set_class(txMsg.Header, CAN_MODULE_CLASS_CHN);
43
 
43
 
44
    txMsg.Id |= channel_id << 8;
44
    txMsg.Id |= ((uint32_t)channel_id) << 8;
45
    txMsg.Id |= chn_ChnMaster_ID;
45
    txMsg.Id |= chn_ChnMaster_ID;
46
 
46
 
47
    txMsg.Length = 2;
47
    txMsg.Length = 2;
48
    txMsg.Data[0] = (value     >>8)&0xFF;
48
    txMsg.Data[0] = (value     >>8)&0xFF;
49
    txMsg.Data[1] = (value        )&0xFF;
49
    txMsg.Data[1] = (value        )&0xFF;