samples: led_apa102c_bitbang: Clean conditional expression
Clean the expression so that it uses the BIT() macro and doesn't abuse
the not (!) operator.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
diff --git a/samples/drivers/led_apa102c_bitbang/src/main.c b/samples/drivers/led_apa102c_bitbang/src/main.c
index 6812648..3d0d134 100644
--- a/samples/drivers/led_apa102c_bitbang/src/main.c
+++ b/samples/drivers/led_apa102c_bitbang/src/main.c
@@ -55,7 +55,7 @@
for (i = 0; i < 32; i++) {
/* MSB goes in first */
- gpio_pin_set_raw(gpio_dev, GPIO_DATA_PIN, !!(rgb & 0x80000000));
+ gpio_pin_set_raw(gpio_dev, GPIO_DATA_PIN, (rgb & BIT(31)) != 0);
/* Latch data into LED */
gpio_pin_set_raw(gpio_dev, GPIO_CLK_PIN, 1);