mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-18 09:29:03 +08:00
run encoder.apply_config on successful dir_find
This commit is contained in:
@@ -506,6 +506,9 @@ void Axis::run_state_machine_loop() {
|
||||
goto invalid_state_label;
|
||||
|
||||
status = encoder_.run_direction_find();
|
||||
// Help facilitate encoder.is_ready without reboot
|
||||
if (status)
|
||||
encoder_.apply_config(motor_.config_.motor_type);
|
||||
} break;
|
||||
|
||||
case AXIS_STATE_ENCODER_HALL_POLARITY_CALIBRATION: {
|
||||
|
||||
@@ -74,8 +74,8 @@ void StatusLedController::update() {
|
||||
} else {
|
||||
// Slow blue pulsating
|
||||
const uint32_t period_ms = 4096;
|
||||
const uint8_t min_brightness = 64;
|
||||
const uint8_t max_brightness = 180;
|
||||
const uint8_t min_brightness = 50;
|
||||
const uint8_t max_brightness = 160;
|
||||
uint32_t brightness = std::abs((int32_t)(t % period_ms) - (int32_t)(period_ms / 2)) * (max_brightness - min_brightness) / (period_ms / 2) + min_brightness;
|
||||
brightness = (brightness * brightness) >> 8; // eye response very roughly sqrt
|
||||
status_led.set_color(rgb_t{0, 0, (uint8_t)brightness});
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"GPIO_MODE_ENC2": 13,
|
||||
"GPIO_MODE_MECH_BRAKE": 14,
|
||||
"GPIO_MODE_STATUS": 15,
|
||||
"GPIO_MODE_BRAKE_RES": 16,
|
||||
"STREAM_PROTOCOL_TYPE_FIBRE": 0,
|
||||
"STREAM_PROTOCOL_TYPE_ASCII": 1,
|
||||
"STREAM_PROTOCOL_TYPE_STDOUT": 2,
|
||||
|
||||
Reference in New Issue
Block a user