Added ppm-pin to lisp, doc update

This commit is contained in:
Benjamin Vedder 2022-09-27 23:07:42 +02:00
parent 35d2dfcff2
commit 06d86d8cc9
2 changed files with 15 additions and 0 deletions

View File

@ -297,6 +297,10 @@ Read system info parameter param. Example:
### App Override Commands
Several app-inputs can be detached from the external interfaces and overridden from lisp. This is useful to take advantage of existing throttle curves and control modes from the apps while providing a custom input source.
#### app-adc-detach
```clj
(app-adc-detach mode state)
; Where
@ -310,6 +314,8 @@ Read system info parameter param. Example:
Detaches a peripherial from the APP ADC
#### app-adc-override
```clj
(app-adc-override mode value)
; Where
@ -1005,6 +1011,7 @@ Configure GPIO pin to mode. Example:
'pin-hall3 ; Sensor port hall3
'pin-adc1 ; ADC1-pin on COMM-port
'pin-adc2 ; ADC2-pin on COMM-port
'pin-ppm ; Signal-pin on PPM-port
; Available modes
'pin-mode-out ; Output

View File

@ -92,6 +92,7 @@ typedef struct {
lbm_uint pin_hall3;
lbm_uint pin_adc1;
lbm_uint pin_adc2;
lbm_uint pin_ppm;
// Settings
lbm_uint l_current_min;
@ -249,6 +250,8 @@ static bool compare_symbol(lbm_uint sym, lbm_uint *comp) {
get_add_symbol("pin-adc1", comp);
} else if (comp == &syms_vesc.pin_adc2) {
get_add_symbol("pin-adc2", comp);
} else if (comp == &syms_vesc.pin_ppm) {
get_add_symbol("pin-ppm", comp);
}
else if (comp == &syms_vesc.l_current_min) {
@ -446,6 +449,11 @@ static bool gpio_get_pin(lbm_uint sym, stm32_gpio_t **port, int *pin) {
#ifdef HW_ADC_EXT2_GPIO
*port = HW_ADC_EXT2_GPIO; *pin = HW_ADC_EXT2_PIN;
return true;
#endif
} else if (compare_symbol(sym, &syms_vesc.pin_ppm)) {
#ifdef HW_ICU_GPIO
*port = HW_ICU_GPIO; *pin = HW_ICU_PIN;
return true;
#endif
}