Update DShotRMT
This commit is contained in:
parent
422ec326a7
commit
e70071887a
|
|
@ -65,7 +65,7 @@ DShotRMT::DShotRMT(gpio_num_t gpio, dshot_mode_t mode, bool is_bidirectional, ui
|
||||||
_preCalculateBitPositions();
|
_preCalculateBitPositions();
|
||||||
|
|
||||||
// Activate internal pullup resistor
|
// Activate internal pullup resistor
|
||||||
gpio_set_pull_mode(_gpio, GPIO_PULLUP_ONLY);
|
// gpio_set_pull_mode(_gpio, GPIO_PULLUP_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constructor using pin number
|
// Constructor using pin number
|
||||||
|
|
@ -350,9 +350,6 @@ dshot_result_t DShotRMT::_initTXChannel()
|
||||||
_tx_channel_config.mem_block_symbols = RMT_BUFFER_SYMBOLS;
|
_tx_channel_config.mem_block_symbols = RMT_BUFFER_SYMBOLS;
|
||||||
_tx_channel_config.trans_queue_depth = RMT_QUEUE_DEPTH;
|
_tx_channel_config.trans_queue_depth = RMT_QUEUE_DEPTH;
|
||||||
|
|
||||||
// Set the final signal level after transmission
|
|
||||||
// For bidirectional, line must be high (pulled up) to allow ESC to respond
|
|
||||||
// For unidirectional, line returns to low (idle)
|
|
||||||
_rmt_tx_config.loop_count = 0; // No automatic loops - real-time calculation
|
_rmt_tx_config.loop_count = 0; // No automatic loops - real-time calculation
|
||||||
_rmt_tx_config.flags.eot_level = _is_bidirectional ? 1 : 0;
|
_rmt_tx_config.flags.eot_level = _is_bidirectional ? 1 : 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,11 +93,6 @@ public:
|
||||||
dshot_result_t sendThrottlePercent(float percent);
|
dshot_result_t sendThrottlePercent(float percent);
|
||||||
dshot_result_t sendCommand(uint16_t command);
|
dshot_result_t sendCommand(uint16_t command);
|
||||||
dshot_result_t sendCommand(dshot_commands_t dshot_command, uint16_t repeat_count = DEFAULT_CMD_REPEAT_COUNT, uint16_t delay_us = DEFAULT_CMD_DELAY_US);
|
dshot_result_t sendCommand(dshot_commands_t dshot_command, uint16_t repeat_count = DEFAULT_CMD_REPEAT_COUNT, uint16_t delay_us = DEFAULT_CMD_DELAY_US);
|
||||||
/**
|
|
||||||
* @brief Gets telemetry data from the ESC.
|
|
||||||
* @param magnet_count Optional. Number of motor magnets. If 0 or omitted, uses the value set by setMotorMagnetCount().
|
|
||||||
* @return dshot_result_t Result containing success status, message, and telemetry data.
|
|
||||||
*/
|
|
||||||
dshot_result_t getTelemetry(uint16_t magnet_count = 0);
|
dshot_result_t getTelemetry(uint16_t magnet_count = 0);
|
||||||
dshot_result_t getESCInfo();
|
dshot_result_t getESCInfo();
|
||||||
dshot_result_t setMotorSpinDirection(bool reversed);
|
dshot_result_t setMotorSpinDirection(bool reversed);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue