void sm1000_leds_switches_init(void);
+#define LED_ON 1 /*!< Turn LED on */
+#define LED_OFF 0 /*!< Turn LED off */
+#define LED_INV -1 /*!< Invert LED state */
+
void led_pwr(int state);
void led_ptt(int state);
void led_rt(int state);
}
void led_pwr(int state) {
- if (state)
+ if (state > 0)
GPIOD->ODR |= (1 << 12);
+ else if (state < 0)
+ GPIOD->ODR ^= (1 << 12);
else
GPIOD->ODR &= ~(1 << 12);
}
void led_ptt(int state) {
- if (state)
+ if (state > 0)
+ GPIOD->ODR |= (1 << 13);
+ else if (state < 0)
GPIOD->ODR |= (1 << 13);
else
GPIOD->ODR &= ~(1 << 13);
}
void led_rt(int state) {
- if (state)
+ if (state > 0)
GPIOD->ODR |= (1 << 14);
+ else if (state < 0)
+ GPIOD->ODR ^= (1 << 14);
else
GPIOD->ODR &= ~(1 << 14);
}
void led_err(int state) {
- if (state)
+ if (state > 0)
GPIOD->ODR |= (1 << 15);
+ else if (state < 0)
+ GPIOD->ODR ^= (1 << 15);
else
GPIOD->ODR &= ~(1 << 15);
}