Skip to content

Commit

Permalink
LCM brightness values are passed as uint8 0..100
Browse files Browse the repository at this point in the history
Convert brightness from 0..1 float to 0..100 integer

Fix: Fix setting brightness for LCM module (Floatwheel)

Signed-off-by: Dado Mista <dadomista@gmail.com>
  • Loading branch information
surfdado authored and lukash committed Mar 24, 2024
1 parent 30e2195 commit e4500bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions refloat/refloat/lcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ void lcm_configure(LcmData *lcm, const CfgLeds *cfg) {
lcm->status_brightness = 0.0f;
} else {
if (cfg->headlights_on) {
lcm->brightness = cfg->headlights.brightness;
lcm->status_brightness = cfg->status.brightness_headlights_on;
lcm->brightness = cfg->headlights.brightness * 100;
lcm->status_brightness = cfg->status.brightness_headlights_on * 100;
} else {
lcm->brightness = cfg->front.brightness;
lcm->status_brightness = cfg->status.brightness_headlights_off;
lcm->brightness = cfg->front.brightness * 100;
lcm->status_brightness = cfg->status.brightness_headlights_off * 100;
}
lcm->brightness_idle = cfg->front.brightness;
lcm->brightness_idle = cfg->front.brightness * 100;
}
}

Expand Down

0 comments on commit e4500bb

Please sign in to comment.