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
5 changes: 5 additions & 0 deletions main/hwconf/vesc/vbms32/hw_vbms32.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ typedef struct {
lbm_uint t_psw_en;
lbm_uint t_psw_max_mos;
lbm_uint psw_wait_init;
lbm_uint beeper_enabled;
} vesc_syms;

static vesc_syms syms_vesc = {0};
Expand Down Expand Up @@ -1073,6 +1074,8 @@ static bool compare_symbol(lbm_uint sym, lbm_uint *comp) {
lbm_add_symbol_const("t_psw_max_mos", comp);
} else if (comp == &syms_vesc.psw_wait_init) {
lbm_add_symbol_const("psw_wait_init", comp);
} else if (comp == &syms_vesc.beeper_enabled) {
lbm_add_symbol_const("beeper_enabled", comp);
}
}

Expand Down Expand Up @@ -1203,6 +1206,8 @@ static lbm_value bms_get_set_param(bool set, lbm_value *args, lbm_uint argn) {
res = get_or_set_float(set, &cfg->t_psw_max_mos, &set_arg);
} else if (compare_symbol(name, &syms_vesc.psw_wait_init)) {
res = get_or_set_bool(set, &cfg->psw_wait_init, &set_arg);
} else if (compare_symbol(name, &syms_vesc.beeper_enabled)) {
res = get_or_set_bool(set, &cfg->beeper_enabled, &set_arg);
}

return res;
Expand Down
3 changes: 3 additions & 0 deletions main/hwconf/vesc/vbms32/hw_vbms32.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ typedef struct {

// Wait for init done before enabling power switch
bool psw_wait_init;

// Enable onboard beeper
bool beeper_enabled;
} main_config_t;

// Default setting Overrides
Expand Down
5 changes: 5 additions & 0 deletions main/hwconf/vesc/vbms32/vbms32_conf_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@
#define CONF_PSW_WAIT_INIT 0
#endif

// Beeper Enabled
#ifndef CONF_BEEPER_ENABLED
#define CONF_BEEPER_ENABLED 1
#endif

// VBMS32_CONF_DEFAULT_H_
#endif

3 changes: 3 additions & 0 deletions main/hwconf/vesc/vbms32/vbms32_confparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ int32_t vbms32_confparser_serialize_main_config_t(uint8_t *buffer, const main_co
buffer[ind++] = conf->t_psw_en;
buffer_append_float16(buffer, conf->t_psw_max_mos, 10, &ind);
buffer[ind++] = conf->psw_wait_init;
buffer[ind++] = conf->beeper_enabled;

return ind;
}
Expand Down Expand Up @@ -146,6 +147,7 @@ bool vbms32_confparser_deserialize_main_config_t(const uint8_t *buffer, main_con
conf->t_psw_en = buffer[ind++];
conf->t_psw_max_mos = buffer_get_float16(buffer, 10, &ind);
conf->psw_wait_init = buffer[ind++];
conf->beeper_enabled = buffer[ind++];

return true;
}
Expand Down Expand Up @@ -205,5 +207,6 @@ void vbms32_confparser_set_defaults_main_config_t(main_config_t *conf) {
conf->t_psw_en = CONF_T_PSW_EN;
conf->t_psw_max_mos = CONF_T_PSW_MAX_MOS;
conf->psw_wait_init = CONF_PSW_WAIT_INIT;
conf->beeper_enabled = CONF_BEEPER_ENABLED;
}

3 changes: 2 additions & 1 deletion main/hwconf/vesc/vbms32/vbms32_confparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include <stdbool.h>

// Constants
#define MAIN_CONFIG_T_SIGNATURE 822273783
#define MAIN_CONFIG_T_SIGNATURE 1886576450
#define SERIALIZED_CONFIG_LENGTH 340

// Functions
int32_t vbms32_confparser_serialize_main_config_t(uint8_t *buffer, const main_config_t *conf);
Expand Down
844 changes: 424 additions & 420 deletions main/hwconf/vesc/vbms32/vbms32_confxml.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion main/hwconf/vesc/vbms32/vbms32_confxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdbool.h>

// Constants
#define DATA_MAIN_CONFIG_T__SIZE 6755
#define DATA_MAIN_CONFIG_T__SIZE 6832

// Variables
extern uint8_t data_main_config_t_[];
Expand Down
14 changes: 14 additions & 0 deletions main/hwconf/vesc/vbms32/vbms32_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,18 @@ p, li { white-space: pre-wrap; }
<cDefine>CONF_PSW_WAIT_INIT</cDefine>
<valInt>0</valInt>
</psw_wait_init>
<beeper_enabled>
<longName>Beeper Enabled</longName>
<type>5</type>
<transmittable>1</transmittable>
<description>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Roboto'; ; font-weight:400; font-style:normal;&quot;&gt;
&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;Enables or disables the beeper in the BMS, defaults to enabled.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</description>
<cDefine>CONF_BEEPER_ENABLED</cDefine>
<valInt>1</valInt>
</beeper_enabled>
</Params>
<SerOrder>
<ser>controller_id</ser>
Expand Down Expand Up @@ -1144,6 +1156,7 @@ p, li { white-space: pre-wrap; }
<ser>t_psw_en</ser>
<ser>t_psw_max_mos</ser>
<ser>psw_wait_init</ser>
<ser>beeper_enabled</ser>
</SerOrder>
<Grouping>
<group>
Expand Down Expand Up @@ -1198,6 +1211,7 @@ p, li { white-space: pre-wrap; }
<param>vc_empty</param>
<param>vc_full</param>
<param>temp_num</param>
<param>beeper_enabled</param>
</subgroupParams>
</subgroup>
<subgroup>
Expand Down