mirror of https://github.com/rusefi/rusefi.git
CanTxMessage::setShortValueMsb
This commit is contained in:
parent
fe684febdf
commit
cfbcedfe2a
|
@ -119,6 +119,12 @@ void CanTxMessage::setShortValue(uint16_t value, size_t offset) {
|
|||
m_frame.data8[offset + 1] = value >> 8;
|
||||
}
|
||||
|
||||
// MOTOROLA order, MSB (Most Significant Byte/Big Endian) comes first.
|
||||
void CanTxMessage::setShortValueMsb(uint16_t value, size_t offset) {
|
||||
m_frame.data8[offset] = value >> 8;
|
||||
m_frame.data8[offset + 1] = value & 0xFF;
|
||||
}
|
||||
|
||||
void CanTxMessage::setBit(size_t byteIdx, size_t bitIdx) {
|
||||
m_frame.data8[byteIdx] |= 1 << bitIdx;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,9 @@ public:
|
|||
*/
|
||||
void setShortValue(uint16_t value, size_t offset);
|
||||
|
||||
// Same as above but big endian
|
||||
void setShortValueMsb(uint16_t value, size_t offset);
|
||||
|
||||
/**
|
||||
* @brief Set a single bit in the transmit buffer. Useful for single-bit flags.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue