Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conf/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/conf/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2700,7 +2700,7 @@ p, li { white-space: pre-wrap; }
<enumNames>Cipher</enumNames>
<enumNames>Mono Cipher</enumNames>
</leds.direction_transition>
<leds.lights_off_when_lifted>
<leds.leds_off_when_lifted>
<longName>Lights Off When Lifted</longName>
<type>5</type>
<transmittable>1</transmittable>
Expand All @@ -2711,7 +2711,7 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;When enabled, turns off front and rear leds when you lift the board nose up (pitch angle &amp;gt; 60°). So that the LEDs don't blast into your eyes when you carry it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
<cDefine>CFG_DFLT_LEDS_LIGHTS_OFF_WHEN_LIFTED</cDefine>
<valInt>1</valInt>
</leds.lights_off_when_lifted>
</leds.leds_off_when_lifted>
<leds.status_on_front_when_lifted>
<longName>Status On Front When Lifted</longName>
<type>5</type>
Expand Down Expand Up @@ -4137,7 +4137,7 @@ p, li { white-space: pre-wrap; }
<ser>leds.headlights_on</ser>
<ser>leds.headlights_transition</ser>
<ser>leds.direction_transition</ser>
<ser>leds.lights_off_when_lifted</ser>
<ser>leds.leds_off_when_lifted</ser>
<ser>leds.status_on_front_when_lifted</ser>
<ser>leds.front.mode</ser>
<ser>leds.front.brightness</ser>
Expand Down Expand Up @@ -4390,7 +4390,7 @@ p, li { white-space: pre-wrap; }
<param>leds.headlights_on</param>
<param>leds.headlights_transition</param>
<param>leds.direction_transition</param>
<param>leds.lights_off_when_lifted</param>
<param>leds.leds_off_when_lifted</param>
<param>leds.status_on_front_when_lifted</param>
<param>::sep::Front</param>
<param>leds.front.mode</param>
Expand Down
6 changes: 3 additions & 3 deletions src/lcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/lcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions src/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -1030,15 +1030,15 @@ 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);
}
}

// 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);
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ui.qml.in
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading