Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate the CLI for resource management. #7712

Merged
merged 3 commits into from Mar 7, 2019

Conversation

Projects
None yet
3 participants
@mikeller
Copy link
Member

mikeller commented Mar 4, 2019

First part: The rename, respecting defaults. Option listing / status showing yet to come at a later stage.

@mikeller mikeller added this to the 4.0 milestone Mar 4, 2019

@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 5, 2019

Fixes #7699.

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 5, 2019

tested now on generic target and i get parse errors with resources

# # resources

# resource BEEPER 1 B04
###ERROR: PARSE ERROR###

# resource MOTOR 1 B00
###ERROR: INDEX NOT BETWEEN 1 AND 8###

# resource MOTOR 2 B01
###ERROR: INDEX NOT BETWEEN 1 AND 8###

# resource MOTOR 3 A03
###ERROR: INDEX NOT BETWEEN 1 AND 8###

# resource MOTOR 4 A02
###ERROR: INDEX NOT BETWEEN 1 AND 8###

# resource LED_STRIP 1 B06
###ERROR: PARSE ERROR###

# resource SERIAL_TX 1 A09
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource SERIAL_RX 1 A10
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource SERIAL_TX 3 B10
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource SERIAL_RX 3 B11
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource SERIAL_TX 6 C06
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource SERIAL_RX 6 C07
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource INVERTER 1 C00
###ERROR: INDEX NOT BETWEEN 1 AND 12###

# resource LED 1 B05
###ERROR: PARSE ERROR###

# resource SPI_SCK 1 A05
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource SPI_MISO 1 A06
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource SPI_MOSI 1 A07
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource SPI_SCK 3 C10
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource SPI_MISO 3 C11
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource SPI_MOSI 3 C12
###ERROR: INDEX NOT BETWEEN 1 AND 3###

# resource ADC_BATT 1 C02
###ERROR: PARSE ERROR###

# resource ADC_CURR 1 C01
###ERROR: PARSE ERROR###

# resource FLASH_CS 1 B03
###ERROR: PARSE ERROR###

# resource GYRO_EXTI 1 C04
###ERROR: INDEX NOT BETWEEN 1 AND 2###

# resource GYRO_CS 1 A04
###ERROR: INDEX NOT BETWEEN 1 AND 2###

# resource USB_DETECT 1 C05
###ERROR: INVALID###

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 5, 2019

diff on native target still lists timers and dma though they have not been changed

@mikeller mikeller force-pushed the mikeller:fix_resource_cli branch from d777747 to 2907684 Mar 5, 2019

@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 5, 2019

@TheIsotopes: Thank you for testing. The display of unchanged settings in diff will have to be addressed later, this is not a breaking issue. But I have fixed the resource command, can you please verify?

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 5, 2019

The parsing error is now fixed ... but dump does not list timer and dma pin

...
resource GYRO_CS 2 NONE

# timer

# dma
dma SPI_TX 1 NONE
dma SPI_TX 2 NONE
dma SPI_TX 3 NONE
dma SPI_RX 1 NONE
dma SPI_RX 2 NONE
dma SPI_RX 3 NONE
dma ADC 1 1
# ADC 1: DMA2 Stream 4 Channel 0
dma ADC 2 NONE
dma ADC 3 NONE
dma UART_TX 1 NONE
dma UART_TX 2 NONE
dma UART_TX 3 NONE
dma UART_TX 4 NONE
dma UART_TX 5 NONE
dma UART_TX 6 NONE
dma UART_TX 7 NONE
dma UART_TX 8 NONE
dma UART_RX 1 NONE
dma UART_RX 2 NONE
dma UART_RX 3 NONE
dma UART_RX 4 NONE
dma UART_RX 5 NONE
dma UART_RX 6 NONE
dma UART_RX 7 NONE
dma UART_RX 8 NONE

# mixer
mixer QUADX1234
...
@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 5, 2019

@TheIsotopes:

Hmm, weird, works for me:

# resources
resource MOTOR 1 C06
[...]

# timer
timer A10 0
[...]

# dma
dma SPI_TX 1 NONE
[...]
dma pin C07 0
# pin C07: DMA1 Stream 5 Channel 5

What target are you testing with? And if it's a universal target, are you sure timers are defined for any pins?

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 5, 2019

I'm testing with STM32F405 on an Revolt FC ... when i using timer and dma alone the list is correct

# timer
timer B00 2
timer B01 2
timer A03 0
timer A02 0
timer B06 0

# dma
dma ADC 1 1
# ADC 1: DMA2 Stream 4 Channel 0
dma pin B00 0
# pin B00: DMA2 Stream 2 Channel 0
dma pin B01 0
# pin B01: DMA2 Stream 2 Channel 0
dma pin A03 0
# pin A03: DMA1 Stream 7 Channel 3
dma pin A02 0
# pin A02: DMA1 Stream 1 Channel 3
dma pin B06 0
# pin B06: DMA1 Stream 0 Channel 2

@mikeller mikeller force-pushed the mikeller:fix_resource_cli branch from 2907684 to 96b33b5 Mar 6, 2019

@mikeller mikeller force-pushed the mikeller:fix_resource_cli branch from 96b33b5 to f7f3504 Mar 6, 2019

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 6, 2019

tested again with latest master 687d066 on REVOLT and MATEKF405-MINI using STM32F405 target

on both fc the same issue as mentioned above :-(

@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 6, 2019

@TheIsotopes: Thanks, I haven't changed anything in the code yet. 😉
The latest push was just housekeeping to keep the target configs up to date with the format...

@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 6, 2019

@TheIsotopes: Now's good for testing. 😉

@mikeller mikeller force-pushed the mikeller:fix_resource_cli branch from fee4ee5 to f1b008b Mar 6, 2019

@TheIsotopes

This comment has been minimized.

Copy link
Contributor

TheIsotopes commented Mar 6, 2019

@mikeller jackpot ... everything is perfect now
issues as mentioned above and also #7699 was fixed ... thx 👍

@mikeller

This comment has been minimized.

Copy link
Member Author

mikeller commented Mar 6, 2019

😁

@mikeller mikeller force-pushed the mikeller:fix_resource_cli branch from f1b008b to fb5c468 Mar 7, 2019

Show resolved Hide resolved src/main/cli/cli.c
@fujin

fujin approved these changes Mar 7, 2019

Copy link
Member

fujin left a comment

Fairly dense but looks good from what I've got through so far, I have not bench tested yet. Please go ahead.

@mikeller mikeller merged commit 80b3a11 into betaflight:master Mar 7, 2019

@mikeller mikeller deleted the mikeller:fix_resource_cli branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.