betaflight / betaflight

Open Source Flight Controller Firmware
GNU General Public License v3.0
8.06k stars 2.87k forks source link

Improve features (+ cli) #13494

Closed ledvinap closed 1 week ago

ledvinap commented 1 month ago

Description in commits.

654b6584079b3778a153ccf6808bb13fb036f7ce needs some discussion:

github-actions[bot] commented 1 month ago

Do you want to test this code? You can flash it directly from Betaflight Configurator:

WARNING: It may be unstable. Use only for testing!

blckmn commented 1 month ago

the command feature list might be worth adding some params - or simply return all, including unavailable as you indicated.

haslinghuis commented 1 month ago

In case of unavailable might have to split in all features - with a list of unavailable features on a second row.

ledvinap commented 1 month ago

the command feature list might be worth adding some params - or simply return all, including unavailable as you indicated.

Problem is that it needs more parsing of cmdline - lot of code with minimum gain.

Currently all are returned, for backward compatibility. New commit splits features on two lines, each with header (even code parsing 'Available:' shall work, with limited feature list

ledvinap commented 1 month ago

When this PR is open - is it worth supporting feature softserial telem -led_st -osd 3d ( = multiple enable.disable in single command)?

blckmn commented 3 weeks ago

When this PR is open - is it worth supporting feature softserial telem -led_st -osd 3d ( = multiple enable.disable in single command)?

this would make the diff and dump interesting... I like the idea, but it might be more complicated than the potential value it would deliver.

nerdCopter commented 3 weeks ago

a4cded977 bare-minimum testing: https://build.betaflight.com/api/builds/9ed43bba544fdfa398274c9e207cc175/json

version

Betaflight / STM32F405 (S405) 4.5.0 May 10 2024 / 19:00:12 (a4cded977) MSP API: 1.46

config rev: 39d434c

start the command batch

batch start

reset configuration to default settings

defaults nosave

board_name FOXEERF405 manufacturer_id FOXE mcu_id 0042004f4e48500920303452 signature

feature

feature TELEMETRY feature LED_STRIP feature OSD

master

set acc_calibration = -11,13,80,1 set osd_canvas_height = 13

profile 0

profile 1

profile 2

profile 3

restore original profile selection

profile 0

rateprofile 0

rateprofile 1

rateprofile 2

rateprofile 3

restore original rateprofile selection

rateprofile 0

save configuration

save

feature

Enabled: RX_SERIAL TELEMETRY LED_STRIP OSD AIRMODE ANTI_GRAVITY

feature list

Available: INFLIGHT_ACC_CAL RX_SERIAL MOTOR_STOP SOFTSERIAL GPS TELEMETRY 3D RSSI_ADC LED_STRIP OSD AIRMODE ESC_SENSOR ANTI_GRAVITY NotSupported: RX_PPM SERVO_TILT RANGEFINDER RX_PARALLEL_PWM DISPLAY CHANNEL_FORWARDING TRANSPONDER RX_SPI

feature ESC_SENSOR

Enabled ESC_SENSOR

feature -LED_STRIP

Disabled LED_STRIP

feature

Enabled: RX_SERIAL TELEMETRY OSD AIRMODE ESC_SENSOR ANTI_GRAVITY

feature RANGEFINDER

Unavailable RANGEFINDER

nerdCopter commented 3 weeks ago

@ledvinap , i do not mind listing unsupported in feature list as you have done. if the ! is used, then such might not be human-readable.

also, maybe feature should output the same as feature list and no need for the extra word list :man_shrugging:

SteveCEvans commented 3 weeks ago

The available list is in the configurator. I think it best if the firmware only reports on the features built into it.

haslinghuis commented 2 weeks ago

@ledvinap please rebase

ledvinap commented 2 weeks ago

The available list is in the configurator. I think it best if the firmware only reports on the features built into it.

I did try to follow old behavior - it did print all features, compiled-in or not. It was meant to remind user that feature does exist, but must be enabled somehow.

I started this PR because I struggled with some feature (maybe SOFTSERIAL, nut I'm not sure) that was not enabled in cloud build. It took some time before I realized it.

nerdCopter commented 2 weeks ago

i like the unavailable list. i would not want to have to search for and compare against some external source. i'd like to repeat:

also, maybe feature should output the same as feature list and no need for the extra word list 🤷‍♂️

IMHO

ledvinap commented 2 weeks ago

@nerdCopter : Enabled / Available / Unavailable ?

Maybe I can even add features that got automatically disabled (since last reboot only)

nerdCopter commented 1 week ago

74ed6e7ab

# version
# Betaflight / STM32F405 (S405) 4.6.0 May 20 2024 / 08:17:02 (74ed6e7ab) MSP API: 1.46
# config rev: 93dfc69
# board: manufacturer_id: FOXE, board_name: FOXEERF405

# feature
Enabled:  RX_SERIAL LED_STRIP OSD AIRMODE ANTI_GRAVITY
Available:  INFLIGHT_ACC_CAL MOTOR_STOP SOFTSERIAL GPS TELEMETRY 3D RSSI_ADC ESC_SENSOR
Unavailable: RX_PPM SERVO_TILT RANGEFINDER RX_PARALLEL_PWM DISPLAY CHANNEL_FORWARDING TRANSPONDER RX_SPI

# feature -LED_STRIP
Disabled LED_STRIP

# feature ESC_SENSOR
Enabled ESC_SENSOR

# feature
Enabled:  RX_SERIAL OSD AIRMODE ESC_SENSOR ANTI_GRAVITY
Available:  INFLIGHT_ACC_CAL MOTOR_STOP SOFTSERIAL GPS TELEMETRY 3D RSSI_ADC LED_STRIP
Unavailable: RX_PPM SERVO_TILT RANGEFINDER RX_PARALLEL_PWM DISPLAY CHANNEL_FORWARDING TRANSPONDER RX_SPI