diff --git a/DShotRMT.cpp b/DShotRMT.cpp index 9d81b97..b767120 100644 --- a/DShotRMT.cpp +++ b/DShotRMT.cpp @@ -64,8 +64,8 @@ void DShotRMT::begin() // Encodes and transmits a valid DShot Throttle value (48 - 2047) void DShotRMT::setThrottle(uint16_t throttle) { - // Safety first - double check input range and 10 bit "translation" - throttle = (constrain(throttle, DSHOT_THROTTLE_MIN, DSHOT_THROTTLE_MAX)) & 0b0000011111111111; + // Safety first - double check input range and 11 bit "translation" + throttle = constrain(throttle, DSHOT_THROTTLE_MIN, DSHOT_THROTTLE_MAX) & 0b0000011111111111; // Has Throttle really changed? if (throttle == _lastThrottle) @@ -181,7 +181,7 @@ uint16_t DShotRMT::assambleDShotPaket(uint16_t value) // Clear container _tx_packet = DSHOT_NULL_PACKET; - // dummy 10bit convertion + // dummy 11bit convertion _tx_packet = value & 0b0000011111111111; // Assemble raw DShot packet and add checksum diff --git a/DShotRMT.h b/DShotRMT.h index a64b5b5..3e003c4 100644 --- a/DShotRMT.h +++ b/DShotRMT.h @@ -85,7 +85,7 @@ private: uint16_t _lastThrottle = DSHOT_FULL_PACKET; uint16_t _received_packet = DSHOT_NULL_PACKET; uint16_t _tx_packet = DSHOT_NULL_PACKET; - uint16_t _packet_crc = DSHOT_NULL_PACKET; + uint16_t _packet_crc = 0; // --- RMT Channel --- rmt_channel_handle_t _rmt_rx_channel = nullptr;