Skip to content

Commit c0207cb

Browse files
Use LEDs consistently, rather than interchangeably with Lights
1 parent 02c5986 commit c0207cb

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎src/conf/datatypes.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ typedef struct {
144144
LedTransition headlights_transition;
145145
LedTransition direction_transition;
146146

147-
bool lights_off_when_lifted;
147+
bool leds_off_when_lifted;
148148
bool status_on_front_when_lifted;
149149

150150
LedBar headlights;

‎src/conf/settings.xml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,7 +2700,7 @@ p, li { white-space: pre-wrap; }
27002700
<enumNames>Cipher</enumNames>
27012701
<enumNames>Mono Cipher</enumNames>
27022702
</leds.direction_transition>
2703-
<leds.lights_off_when_lifted>
2703+
<leds.leds_off_when_lifted>
27042704
<longName>Lights Off When Lifted</longName>
27052705
<type>5</type>
27062706
<transmittable>1</transmittable>
@@ -2711,7 +2711,7 @@ p, li { white-space: pre-wrap; }
27112711
&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>
27122712
<cDefine>CFG_DFLT_LEDS_LIGHTS_OFF_WHEN_LIFTED</cDefine>
27132713
<valInt>1</valInt>
2714-
</leds.lights_off_when_lifted>
2714+
</leds.leds_off_when_lifted>
27152715
<leds.status_on_front_when_lifted>
27162716
<longName>Status On Front When Lifted</longName>
27172717
<type>5</type>
@@ -4137,7 +4137,7 @@ p, li { white-space: pre-wrap; }
41374137
<ser>leds.headlights_on</ser>
41384138
<ser>leds.headlights_transition</ser>
41394139
<ser>leds.direction_transition</ser>
4140-
<ser>leds.lights_off_when_lifted</ser>
4140+
<ser>leds.leds_off_when_lifted</ser>
41414141
<ser>leds.status_on_front_when_lifted</ser>
41424142
<ser>leds.front.mode</ser>
41434143
<ser>leds.front.brightness</ser>
@@ -4390,7 +4390,7 @@ p, li { white-space: pre-wrap; }
43904390
<param>leds.headlights_on</param>
43914391
<param>leds.headlights_transition</param>
43924392
<param>leds.direction_transition</param>
4393-
<param>leds.lights_off_when_lifted</param>
4393+
<param>leds.leds_off_when_lifted</param>
43944394
<param>leds.status_on_front_when_lifted</param>
43954395
<param>::sep::Front</param>
43964396
<param>leds.front.mode</param>

‎src/lcm.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void lcm_init(LcmData *lcm, CfgHwLeds *hw_cfg) {
3131
lcm->status_brightness = 0;
3232
lcm->name[0] = '\0';
3333
lcm->payload_size = 0;
34-
lcm->lights_off_when_lifted = true;
34+
lcm->leds_off_when_lifted = true;
3535
}
3636

3737
void lcm_configure(LcmData *lcm, const Leds *leds) {
@@ -56,7 +56,7 @@ void lcm_configure(LcmData *lcm, const Leds *leds) {
5656
}
5757
lcm->brightness_idle = cfg->front.brightness * 100;
5858
}
59-
lcm->lights_off_when_lifted = cfg->lights_off_when_lifted;
59+
lcm->leds_off_when_lifted = cfg->leds_off_when_lifted;
6060
}
6161

6262
void lcm_poll_request(LcmData *lcm, uint8_t *buffer, size_t len) {
@@ -102,7 +102,7 @@ void lcm_poll_response(
102102
buffer[ind++] = fminf(100, fabsf(motor->duty_cycle.value * 100));
103103
} else {
104104
// pitch is a value between -180 and +180, so abs(pitch) fits into uint8
105-
buffer[ind++] = lcm->lights_off_when_lifted ? fabsf(pitch) : 0;
105+
buffer[ind++] = lcm->leds_off_when_lifted ? fabsf(pitch) : 0;
106106
}
107107

108108
buffer_append_float16(buffer, motor->erpm, 1e0, &ind);

‎src/lcm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct {
4242
uint8_t brightness;
4343
uint8_t brightness_idle;
4444
uint8_t status_brightness;
45-
bool lights_off_when_lifted;
45+
bool leds_off_when_lifted;
4646

4747
char name[MAX_LCM_NAME_LENGTH];
4848
uint8_t payload[MAX_LCM_PAYLOAD_LENGTH];

‎src/leds.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ void leds_update(
984984
} else if (leds->board_is_upright && leds->pitch < 50) {
985985
leds->board_is_upright = false;
986986
leds->status_idle_time = current_time;
987-
if (leds->cfg->lights_off_when_lifted) {
987+
if (leds->cfg->leds_off_while_lifted) {
988988
front_rear_animation_reset(leds, current_time);
989989
}
990990
}
@@ -1030,15 +1030,15 @@ void leds_update(
10301030
if (status_on_front) {
10311031
rate_limitf(&leds->front_strip.brightness, status_brightness, BR_RATE);
10321032
} else {
1033-
if (leds->board_is_upright && leds->cfg->lights_off_when_lifted) {
1033+
if (leds->board_is_upright && leds->cfg->leds_off_while_lifted) {
10341034
rate_limitf(&leds->front_strip.brightness, 0.0f, BR_RATE);
10351035
} else {
10361036
rate_limitf(&leds->front_strip.brightness, leds->front_bar->brightness, BR_RATE);
10371037
}
10381038
}
10391039

10401040
// rear brightness
1041-
if (leds->board_is_upright && leds->cfg->lights_off_when_lifted) {
1041+
if (leds->board_is_upright && leds->cfg->leds_off_while_lifted) {
10421042
rate_limitf(&leds->rear_strip.brightness, 0.0f, BR_RATE);
10431043
} else {
10441044
rate_limitf(&leds->rear_strip.brightness, leds->rear_bar->brightness, BR_RATE);
@@ -1234,7 +1234,7 @@ void leds_update(
12341234

12351235
if (leds->cfg->status_on_front_when_lifted && leds->status_on_front_blend > 0.0f &&
12361236
leds->front_strip.length > 0) {
1237-
if (leds->cfg->lights_off_when_lifted &&
1237+
if (leds->cfg->leds_off_while_lifted &&
12381238
current_time - leds->status_on_front_idle_time > 3.0f) {
12391239
rate_limitf(&leds->status_on_front_idle_blend, 1.0f, BR_RATE);
12401240
} else {

‎ui.qml.in‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7699,7 +7699,7 @@ Item {
76997699
Button {
77007700
Layout.preferredWidth: 3 * unit
77017701
Layout.alignment: Qt.AlignHCenter
7702-
text: lights.on ? "Lights Off" : "Lights On"
7702+
text: lights.on ? "LEDs Off" : "LEDs On"
77037703
onClicked: {
77047704
commands.sendLightsControl(!lights.on);
77057705
}

0 commit comments

Comments
 (0)