diff --git a/src/conf/datatypes.h b/src/conf/datatypes.h index d7c22bd8..0d908fa3 100644 --- a/src/conf/datatypes.h +++ b/src/conf/datatypes.h @@ -144,7 +144,7 @@ typedef struct { LedTransition headlights_transition; LedTransition direction_transition; - bool lights_off_when_lifted; + bool leds_off_when_lifted; bool status_on_front_when_lifted; LedBar headlights; diff --git a/src/conf/settings.xml b/src/conf/settings.xml index 779b0900..5df189e1 100644 --- a/src/conf/settings.xml +++ b/src/conf/settings.xml @@ -2700,7 +2700,7 @@ p, li { white-space: pre-wrap; } Cipher Mono Cipher - + Lights Off When Lifted 5 1 @@ -2711,7 +2711,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When enabled, turns off front and rear leds when you lift the board nose up (pitch angle &gt; 60°). So that the LEDs don't blast into your eyes when you carry it.</p></body></html> CFG_DFLT_LEDS_LIGHTS_OFF_WHEN_LIFTED 1 - + Status On Front When Lifted 5 @@ -4137,7 +4137,7 @@ p, li { white-space: pre-wrap; } leds.headlights_on leds.headlights_transition leds.direction_transition - leds.lights_off_when_lifted + leds.leds_off_when_lifted leds.status_on_front_when_lifted leds.front.mode leds.front.brightness @@ -4390,7 +4390,7 @@ p, li { white-space: pre-wrap; } leds.headlights_on leds.headlights_transition leds.direction_transition - leds.lights_off_when_lifted + leds.leds_off_when_lifted leds.status_on_front_when_lifted ::sep::Front leds.front.mode diff --git a/src/lcm.c b/src/lcm.c index e1975bcf..72673e52 100644 --- a/src/lcm.c +++ b/src/lcm.c @@ -31,7 +31,7 @@ void lcm_init(LcmData *lcm, CfgHwLeds *hw_cfg) { lcm->status_brightness = 0; lcm->name[0] = '\0'; lcm->payload_size = 0; - lcm->lights_off_when_lifted = true; + lcm->leds_off_when_lifted = true; } void lcm_configure(LcmData *lcm, const Leds *leds) { @@ -56,7 +56,7 @@ void lcm_configure(LcmData *lcm, const Leds *leds) { } lcm->brightness_idle = cfg->front.brightness * 100; } - lcm->lights_off_when_lifted = cfg->lights_off_when_lifted; + lcm->leds_off_when_lifted = cfg->leds_off_when_lifted; } void lcm_poll_request(LcmData *lcm, uint8_t *buffer, size_t len) { @@ -102,7 +102,7 @@ void lcm_poll_response( buffer[ind++] = fminf(100, fabsf(motor->duty_cycle.value * 100)); } else { // pitch is a value between -180 and +180, so abs(pitch) fits into uint8 - buffer[ind++] = lcm->lights_off_when_lifted ? fabsf(pitch) : 0; + buffer[ind++] = lcm->leds_off_when_lifted ? fabsf(pitch) : 0; } buffer_append_float16(buffer, motor->erpm, 1e0, &ind); diff --git a/src/lcm.h b/src/lcm.h index 4bb8e33c..fbe12b06 100644 --- a/src/lcm.h +++ b/src/lcm.h @@ -42,7 +42,7 @@ typedef struct { uint8_t brightness; uint8_t brightness_idle; uint8_t status_brightness; - bool lights_off_when_lifted; + bool leds_off_when_lifted; char name[MAX_LCM_NAME_LENGTH]; uint8_t payload[MAX_LCM_PAYLOAD_LENGTH]; diff --git a/src/leds.c b/src/leds.c index a998edac..a146781f 100644 --- a/src/leds.c +++ b/src/leds.c @@ -984,7 +984,7 @@ void leds_update( } else if (leds->board_is_upright && leds->pitch < 50) { leds->board_is_upright = false; leds->status_idle_time = current_time; - if (leds->cfg->lights_off_when_lifted) { + if (leds->cfg->leds_off_while_lifted) { front_rear_animation_reset(leds, current_time); } } @@ -1030,7 +1030,7 @@ void leds_update( if (status_on_front) { rate_limitf(&leds->front_strip.brightness, status_brightness, BR_RATE); } else { - if (leds->board_is_upright && leds->cfg->lights_off_when_lifted) { + if (leds->board_is_upright && leds->cfg->leds_off_while_lifted) { rate_limitf(&leds->front_strip.brightness, 0.0f, BR_RATE); } else { rate_limitf(&leds->front_strip.brightness, leds->front_bar->brightness, BR_RATE); @@ -1038,7 +1038,7 @@ void leds_update( } // rear brightness - if (leds->board_is_upright && leds->cfg->lights_off_when_lifted) { + if (leds->board_is_upright && leds->cfg->leds_off_while_lifted) { rate_limitf(&leds->rear_strip.brightness, 0.0f, BR_RATE); } else { rate_limitf(&leds->rear_strip.brightness, leds->rear_bar->brightness, BR_RATE); @@ -1234,7 +1234,7 @@ void leds_update( if (leds->cfg->status_on_front_when_lifted && leds->status_on_front_blend > 0.0f && leds->front_strip.length > 0) { - if (leds->cfg->lights_off_when_lifted && + if (leds->cfg->leds_off_while_lifted && current_time - leds->status_on_front_idle_time > 3.0f) { rate_limitf(&leds->status_on_front_idle_blend, 1.0f, BR_RATE); } else { diff --git a/ui.qml.in b/ui.qml.in index 83ac8077..f3923f83 100644 --- a/ui.qml.in +++ b/ui.qml.in @@ -7699,7 +7699,7 @@ Item { Button { Layout.preferredWidth: 3 * unit Layout.alignment: Qt.AlignHCenter - text: lights.on ? "Lights Off" : "Lights On" + text: lights.on ? "LEDs Off" : "LEDs On" onClicked: { commands.sendLightsControl(!lights.on); }