mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 08:45:36 +03:00
Improved Resource command output.
This commit is contained in:
parent
c4e75e456c
commit
67d448d8ea
41 changed files with 154 additions and 164 deletions
|
@ -1,46 +1,51 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define RESOURCE_INDEX(x) x + 1
|
||||
|
||||
typedef enum {
|
||||
OWNER_FREE = 0,
|
||||
OWNER_PWMINPUT,
|
||||
OWNER_PPMINPUT,
|
||||
OWNER_PWMOUTPUT_MOTOR,
|
||||
OWNER_PWMOUTPUT_SERVO,
|
||||
OWNER_SOFTSERIAL_RX,
|
||||
OWNER_SOFTSERIAL_TX,
|
||||
OWNER_SOFTSERIAL_RXTX, // bidirectional pin for softserial
|
||||
OWNER_SOFTSERIAL_AUXTIMER, // timer channel is used for softserial. No IO function on pin
|
||||
OWNER_MOTOR,
|
||||
OWNER_SERVO,
|
||||
OWNER_SOFTSERIAL,
|
||||
OWNER_ADC,
|
||||
OWNER_SERIAL_RX,
|
||||
OWNER_SERIAL_TX,
|
||||
OWNER_SERIAL_RXTX,
|
||||
OWNER_SERIAL,
|
||||
OWNER_PINDEBUG,
|
||||
OWNER_TIMER,
|
||||
OWNER_SONAR,
|
||||
OWNER_SYSTEM,
|
||||
OWNER_SPI,
|
||||
OWNER_I2C,
|
||||
OWNER_SDCARD,
|
||||
OWNER_FLASH,
|
||||
OWNER_USB,
|
||||
OWNER_BEEPER,
|
||||
OWNER_OSD,
|
||||
OWNER_BARO,
|
||||
OWNER_MPU,
|
||||
OWNER_INVERTER,
|
||||
OWNER_LED_STRIP,
|
||||
OWNER_LED,
|
||||
OWNER_RX,
|
||||
OWNER_TOTAL_COUNT
|
||||
} resourceOwner_t;
|
||||
|
||||
extern const char * const ownerNames[OWNER_TOTAL_COUNT];
|
||||
|
||||
// Currently TIMER should be shared resource (softserial dualtimer and timerqueue needs to allocate timer channel, but pin can be used for other function)
|
||||
// with mode switching (shared serial ports, ...) this will need some improvement
|
||||
typedef enum {
|
||||
RESOURCE_NONE = 0,
|
||||
RESOURCE_INPUT = 1 << 0,
|
||||
RESOURCE_OUTPUT = 1 << 1,
|
||||
RESOURCE_IO = RESOURCE_INPUT | RESOURCE_OUTPUT,
|
||||
RESOURCE_TIMER = 1 << 2,
|
||||
RESOURCE_TIMER_DUAL = 1 << 3, // channel used in dual-capture, other channel will be allocated too
|
||||
RESOURCE_USART = 1 << 4,
|
||||
RESOURCE_ADC = 1 << 5,
|
||||
RESOURCE_EXTI = 1 << 6,
|
||||
RESOURCE_I2C = 1 << 7,
|
||||
RESOURCE_SPI = 1 << 8,
|
||||
RESOURCE_INPUT, RESOURCE_OUTPUT, RESOURCE_IO,
|
||||
RESOURCE_TIMER,
|
||||
RESOURCE_UART_TX, RESOURCE_UART_RX, RESOURCE_UART_TXRX,
|
||||
RESOURCE_EXTI,
|
||||
RESOURCE_I2C_SCL, RESOURCE_I2C_SDA,
|
||||
RESOURCE_SPI_SCK, RESOURCE_SPI_MOSI, RESOURCE_SPI_MISO, RESOURCE_SPI_CS,
|
||||
RESOURCE_ADC_BATTERY, RESOURCE_ADC_RSSI, RESOURCE_ADC_EXTERNAL1, RESOURCE_ADC_CURRENT,
|
||||
RESOURCE_TOTAL_COUNT
|
||||
} resourceType_t;
|
||||
|
||||
extern const char * const resourceNames[RESOURCE_TOTAL_COUNT];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue