Added app-to-use to lispbm configuration parameters

This commit is contained in:
Benjamin Vedder 2022-07-13 13:06:52 +02:00
parent 3375de36c0
commit d458b0f10e
2 changed files with 21 additions and 0 deletions

View File

@ -1079,6 +1079,19 @@ The following selection of app and motor parameters can be read and set from Lis
'foc-sl-erpm-hfi ; ERPM where to move to sensorless in HFI mode
'min-speed ; Minimum speed in meters per second (a negative value)
'max-speed ; Maximum speed in meters per second
'app-to-use ; App to use
; 0: APP_NONE
; 1: APP_PPM
; 2: APP_ADC
; 3: APP_UART
; 4: APP_PPM_UART
; 5: APP_ADC_UART
; 6: APP_NUNCHUK
; 7: APP_NRF
; 8: APP_CUSTOM
; 9: APP_BALANCE
; 10: APP_PAS
; 11: APP_ADC_PAS
'controller-id ; VESC CAN ID
'ppm-ctrl-type ; PPM Control Type
; 0: PPM_CTRL_TYPE_NONE

View File

@ -125,6 +125,7 @@ typedef struct {
lbm_uint min_speed;
lbm_uint max_speed;
lbm_uint controller_id;
lbm_uint app_to_use;
lbm_uint ppm_ctrl_type;
lbm_uint ppm_pulse_start;
lbm_uint ppm_pulse_end;
@ -312,6 +313,8 @@ static bool compare_symbol(lbm_uint sym, lbm_uint *comp) {
get_add_symbol("max-speed", comp);
} else if (comp == &syms_vesc.controller_id) {
get_add_symbol("controller-id", comp);
} else if (comp == &syms_vesc.app_to_use) {
get_add_symbol("app-to-use", comp);
} else if (comp == &syms_vesc.ppm_ctrl_type) {
get_add_symbol("ppm-ctrl-type", comp);
} else if (comp == &syms_vesc.ppm_pulse_start) {
@ -2687,6 +2690,9 @@ static lbm_value ext_conf_set(lbm_value *args, lbm_uint argn) {
} else if (compare_symbol(name, &syms_vesc.foc_sl_erpm_hfi)) {
mcconf->foc_sl_erpm_hfi = lbm_dec_as_float(args[1]);
changed_mc = 2;
} else if (compare_symbol(name, &syms_vesc.app_to_use)) {
appconf->app_to_use = lbm_dec_as_i32(args[1]);
changed_app = 2;
} else if (compare_symbol(name, &syms_vesc.ppm_ctrl_type)) {
appconf->app_ppm_conf.ctrl_type = lbm_dec_as_i32(args[1]);
changed_app = 2;
@ -2889,6 +2895,8 @@ static lbm_value ext_conf_get(lbm_value *args, lbm_uint argn) {
res = lbm_enc_float(mcconf->l_max_erpm / speed_fact);
} else if (compare_symbol(name, &syms_vesc.controller_id)) {
res = lbm_enc_i(appconf->controller_id);
} else if (compare_symbol(name, &syms_vesc.app_to_use)) {
res = lbm_enc_i(appconf->app_to_use);
} else if (compare_symbol(name, &syms_vesc.ppm_ctrl_type)) {
res = lbm_enc_i(appconf->app_ppm_conf.ctrl_type);
} else if (compare_symbol(name, &syms_vesc.ppm_pulse_start)) {