mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 06:23:33 +08:00
Removed v4pro cloned v4 inappropriate definitions (#6808)
* Remove remove safty swtich LED from FMU control * Differentiate GPIO_BTN_SAFETY_FMU from GPIO_BTN_SAFETY
This commit is contained in:
@@ -297,8 +297,7 @@ __BEGIN_DECLS
|
|||||||
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
|
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
|
||||||
|
|
||||||
#define GPIO_RSSI_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1)
|
#define GPIO_RSSI_IN (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN1)
|
||||||
#define GPIO_LED_SAFETY (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN3)
|
#define GPIO_BTN_SAFETY_FMU (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4)
|
||||||
#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN4)
|
|
||||||
#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
|
#define GPIO_SBUS_INV (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
|
||||||
#define INVERT_RC_INPUT(_s) px4_arch_gpiowrite(GPIO_SBUS_INV, _s)
|
#define INVERT_RC_INPUT(_s) px4_arch_gpiowrite(GPIO_SBUS_INV, _s)
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ stm32_boardinitialize(void)
|
|||||||
// stm32_configgpio(GPIO_SPEKTRUM_PWR_EN);
|
// stm32_configgpio(GPIO_SPEKTRUM_PWR_EN);
|
||||||
stm32_configgpio(GPIO_8266_PD);
|
stm32_configgpio(GPIO_8266_PD);
|
||||||
stm32_configgpio(GPIO_8266_RST);
|
stm32_configgpio(GPIO_8266_RST);
|
||||||
stm32_configgpio(GPIO_BTN_SAFETY);
|
stm32_configgpio(GPIO_BTN_SAFETY_FMU);
|
||||||
|
|
||||||
#ifdef GPIO_RC_OUT
|
#ifdef GPIO_RC_OUT
|
||||||
stm32_configgpio(GPIO_RC_OUT); /* Serial RC output pin */
|
stm32_configgpio(GPIO_RC_OUT); /* Serial RC output pin */
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ __END_DECLS
|
|||||||
static uint32_t g_ledmap[] = {
|
static uint32_t g_ledmap[] = {
|
||||||
GPIO_LED_BLUE, // Indexed by LED_BLUE
|
GPIO_LED_BLUE, // Indexed by LED_BLUE
|
||||||
GPIO_LED_RED, // Indexed by LED_RED, LED_AMBER
|
GPIO_LED_RED, // Indexed by LED_RED, LED_AMBER
|
||||||
GPIO_LED_SAFETY, // Indexed by LED_SAFETY
|
0, // Indexed by LED_SAFETY
|
||||||
GPIO_LED_GREEN, // Indexed by LED_GREEN
|
GPIO_LED_GREEN, // Indexed by LED_GREEN
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -73,20 +73,28 @@ __EXPORT void led_init(void)
|
|||||||
{
|
{
|
||||||
/* Configure LED GPIOs for output */
|
/* Configure LED GPIOs for output */
|
||||||
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
|
for (size_t l = 0; l < (sizeof(g_ledmap) / sizeof(g_ledmap[0])); l++) {
|
||||||
stm32_configgpio(g_ledmap[l]);
|
if (g_ledmap[l] != 0) {
|
||||||
|
stm32_configgpio(g_ledmap[l]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void phy_set_led(int led, bool state)
|
static void phy_set_led(int led, bool state)
|
||||||
{
|
{
|
||||||
/* Pull Down to switch on */
|
/* Pull Down to switch on */
|
||||||
stm32_gpiowrite(g_ledmap[led], !state);
|
if (g_ledmap[led] != 0) {
|
||||||
|
stm32_gpiowrite(g_ledmap[led], !state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool phy_get_led(int led)
|
static bool phy_get_led(int led)
|
||||||
{
|
{
|
||||||
|
|
||||||
return !stm32_gpioread(g_ledmap[led]);
|
if (g_ledmap[led] != 0) {
|
||||||
|
return !stm32_gpioread(g_ledmap[led]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__EXPORT void led_on(int led)
|
__EXPORT void led_on(int led)
|
||||||
|
|||||||
Reference in New Issue
Block a user