From 2581badabd232e483d575b85f078d14772153f29 Mon Sep 17 00:00:00 2001 From: Mirko Denecke Date: Wed, 22 Jul 2020 11:29:27 +0200 Subject: [PATCH] Add ifdef to invert heater pin for px4 IO firmware. --- src/modules/px4iofirmware/px4io.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/px4iofirmware/px4io.h b/src/modules/px4iofirmware/px4io.h index 0ca1819dbf..3d0a1d5452 100644 --- a/src/modules/px4iofirmware/px4io.h +++ b/src/modules/px4iofirmware/px4io.h @@ -159,7 +159,12 @@ extern output_limit_t pwm_limit; /* * GPIO handling. */ +/* HEX Cube Orange and Cube Yellow uses an inverted signal to control the IMU heater */ +#ifdef CONFIG_ARCH_BOARD_HEX_IO_V2 +#define LED_BLUE(_s) px4_arch_gpiowrite(GPIO_LED1, (_s)) +#else #define LED_BLUE(_s) px4_arch_gpiowrite(GPIO_LED1, !(_s)) +#endif #define LED_AMBER(_s) px4_arch_gpiowrite(GPIO_LED2, !(_s)) #define LED_SAFETY(_s) px4_arch_gpiowrite(GPIO_LED3, !(_s)) #define LED_RING(_s) px4_arch_gpiowrite(GPIO_LED4, (_s))