Skip to content
Open
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
3 changes: 1 addition & 2 deletions src/conf/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3591,8 +3591,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;">The rest of the options is ignored for the <span style=" font-style:italic;">External</span> LED type.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Board restart required for changes to take effect.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
&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;Note: Pressing both footpad sensors when turning on the board will disable the LED initialization. Use if the LEDs break your VESC in a way that prevents you to connect and change configuration (e.g. due to an overcurrent).&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
<cDefine>CFG_DFLT_HARDWARE_LED_MODE</cDefine>
<valInt>0</valInt>
<enumNames>Off</enumNames>
Expand Down
6 changes: 2 additions & 4 deletions src/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ void leds_init(Leds *leds) {
led_driver_init(&leds->led_driver);
}

void leds_setup(Leds *leds, CfgHwLeds *hw_cfg, const CfgLeds *cfg, FootpadSensorState fs_state) {
void leds_setup(Leds *leds, CfgHwLeds *hw_cfg, const CfgLeds *cfg) {
uint8_t status_offset = 0;
uint8_t front_offset = 0;
uint8_t rear_offset = 0;
Expand Down Expand Up @@ -823,9 +823,7 @@ void leds_setup(Leds *leds, CfgHwLeds *hw_cfg, const CfgLeds *cfg, FootpadSensor
leds->status_strip.length + leds->front_strip.length + leds->rear_strip.length;

uint32_t *led_data = NULL;
if (fs_state == FS_BOTH) {
log_msg("Both sensors pressed, not initializing LEDs.");
} else if (leds->front_strip.length + leds->rear_strip.length > LEDS_FRONT_AND_REAR_COUNT_MAX) {
if (leds->front_strip.length + leds->rear_strip.length > LEDS_FRONT_AND_REAR_COUNT_MAX) {
log_error("Front and rear LED counts exceed maximum.");
} else if (hw_cfg->mode & LED_MODE_INTERNAL && led_count > 0) {
led_data = VESC_IF->malloc(sizeof(uint32_t) * led_count);
Expand Down
2 changes: 1 addition & 1 deletion src/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ typedef struct {

void leds_init(Leds *leds);

void leds_setup(Leds *leds, CfgHwLeds *hw_cfg, const CfgLeds *cfg, FootpadSensorState fs_state);
void leds_setup(Leds *leds, CfgHwLeds *hw_cfg, const CfgLeds *cfg);

void leds_configure(Leds *leds, const CfgLeds *cfg);

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,7 @@ INIT_FUN(lib_info *info) {
}

footpad_sensor_update(&d->footpad, &d->float_conf);
leds_setup(&d->leds, &d->float_conf.hardware.leds, &d->float_conf.leds, d->footpad.state);
leds_setup(&d->leds, &d->float_conf.hardware.leds, &d->float_conf.leds);

VESC_IF->imu_set_read_callback(imu_ref_callback);
VESC_IF->conf_custom_add_config(get_cfg, set_cfg, get_cfg_xml);
Expand Down