run encoder.apply_config on successful dir_find

This commit is contained in:
Oskar Weigl
2021-04-13 23:29:45 -04:00
committed by PAJohnson
parent fee2aa60dc
commit 26cd9ecbe9
3 changed files with 6 additions and 2 deletions
+3
View File
@@ -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: {
+2 -2
View File
@@ -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});
+1
View File
@@ -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,