diff --git a/libuavcan/src/marshal/uc_float_spec.cpp b/libuavcan/src/marshal/uc_float_spec.cpp index 13a1a7ac62..267e0a6bc9 100644 --- a/libuavcan/src/marshal/uc_float_spec.cpp +++ b/libuavcan/src/marshal/uc_float_spec.cpp @@ -58,7 +58,7 @@ uint16_t IEEE754Converter::nativeIeeeToHalf(float value) out = uint16_t(in.u >> 13); /* Take the bits! */ } - out |= uint16_t(sign >> 16); + out = uint16_t(out | (sign >> 16)); return out; } diff --git a/libuavcan/src/transport/uc_can_io.cpp b/libuavcan/src/transport/uc_can_io.cpp index d6417a670c..aa53d0c914 100644 --- a/libuavcan/src/transport/uc_can_io.cpp +++ b/libuavcan/src/transport/uc_can_io.cpp @@ -314,7 +314,7 @@ uint8_t CanIOManager::makePendingTxMask() const { if (!tx_queues_[i]->isEmpty()) { - write_mask |= uint8_t(1 << i); + write_mask = uint8_t(write_mask | (1 << i)); } } return write_mask;