mirror of https://github.com/rusefi/bldc.git
Configure servodec with app ppm options when started from lib or lbm
This commit is contained in:
parent
6482fcda39
commit
f97ff0502f
|
@ -584,6 +584,10 @@ static float lib_get_ppm(void) {
|
|||
if (!servodec_is_running()) {
|
||||
servo_simple_stop();
|
||||
servodec_init(0);
|
||||
servodec_set_pulse_options(
|
||||
app_get_configuration()->app_ppm_conf.pulse_start,
|
||||
app_get_configuration()->app_ppm_conf.pulse_end,
|
||||
app_get_configuration()->app_ppm_conf.median_filter);
|
||||
}
|
||||
|
||||
return servodec_get_servo(0);
|
||||
|
|
|
@ -488,6 +488,10 @@ static lbm_value ext_get_ppm(lbm_value *args, lbm_uint argn) {
|
|||
if (!servodec_is_running()) {
|
||||
servo_simple_stop();
|
||||
servodec_init(0);
|
||||
servodec_set_pulse_options(
|
||||
app_get_configuration()->app_ppm_conf.pulse_start,
|
||||
app_get_configuration()->app_ppm_conf.pulse_end,
|
||||
app_get_configuration()->app_ppm_conf.median_filter);
|
||||
}
|
||||
|
||||
return lbm_enc_float(servodec_get_servo(0));
|
||||
|
|
Loading…
Reference in New Issue