Change datatype for led pins from int8_t to gpio_num_t

This commit is contained in:
Thomas Basler
2025-02-07 23:41:01 +01:00
parent dd515cd308
commit c661155028
4 changed files with 13 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ struct PinMapping_t {
uint8_t display_cs; uint8_t display_cs;
uint8_t display_reset; uint8_t display_reset;
int8_t led[PINMAPPING_LED_COUNT]; gpio_num_t led[PINMAPPING_LED_COUNT];
}; };
class PinMappingClass { class PinMappingClass {

View File

@@ -233,8 +233,8 @@ build_flags = ${env.build_flags}
-DHOYMILES_PIN_IRQ=47 -DHOYMILES_PIN_IRQ=47
-DHOYMILES_PIN_CE=38 -DHOYMILES_PIN_CE=38
-DHOYMILES_PIN_CS=37 -DHOYMILES_PIN_CS=37
-DLED0=17 -DLED0=GPIO_NUM_17
-DLED1=18 -DLED1=GPIO_NUM_18
-DARDUINO_USB_MODE=1 -DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_CDC_ON_BOOT=1
@@ -250,8 +250,8 @@ build_flags = ${env.build_flags}
-DHOYMILES_PIN_IRQ=47 -DHOYMILES_PIN_IRQ=47
-DHOYMILES_PIN_CE=38 -DHOYMILES_PIN_CE=38
-DHOYMILES_PIN_CS=37 -DHOYMILES_PIN_CS=37
-DLED0=17 -DLED0=GPIO_NUM_17
-DLED1=18 -DLED1=GPIO_NUM_18
-DCMT_CLK=6 -DCMT_CLK=6
-DCMT_CS=4 -DCMT_CS=4
-DCMT_FCS=21 -DCMT_FCS=21
@@ -273,8 +273,8 @@ build_flags = ${env.build_flags}
-DHOYMILES_PIN_IRQ=47 -DHOYMILES_PIN_IRQ=47
-DHOYMILES_PIN_CE=38 -DHOYMILES_PIN_CE=38
-DHOYMILES_PIN_CS=37 -DHOYMILES_PIN_CS=37
-DLED0=17 -DLED0=GPIO_NUM_17
-DLED1=18 -DLED1=GPIO_NUM_18
-DCMT_CLK=6 -DCMT_CLK=6
-DCMT_CS=4 -DCMT_CS=4
-DCMT_FCS=21 -DCMT_FCS=21

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
/* /*
* Copyright (C) 2023-2024 Thomas Basler and others * Copyright (C) 2023-2025 Thomas Basler and others
*/ */
#include "Led_Single.h" #include "Led_Single.h"
#include "Configuration.h" #include "Configuration.h"
@@ -53,7 +53,7 @@ void LedSingleClass::init(Scheduler& scheduler)
const auto& pin = PinMapping.get(); const auto& pin = PinMapping.get();
for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) { for (uint8_t i = 0; i < PINMAPPING_LED_COUNT; i++) {
if (pin.led[i] >= 0) { if (pin.led[i] > GPIO_NUM_NC) {
pinMode(pin.led[i], OUTPUT); pinMode(pin.led[i], OUTPUT);
setLed(i, false); setLed(i, false);
ledActive = true; ledActive = true;
@@ -131,7 +131,7 @@ void LedSingleClass::setLed(const uint8_t ledNo, const bool ledState)
const auto& pin = PinMapping.get(); const auto& pin = PinMapping.get();
const auto& config = Configuration.get(); const auto& config = Configuration.get();
if (pin.led[ledNo] < 0) { if (pin.led[ledNo] == GPIO_NUM_NC) {
return; return;
} }

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
/* /*
* Copyright (C) 2022 - 2023 Thomas Basler and others * Copyright (C) 2022 - 2025 Thomas Basler and others
*/ */
#include "PinMapping.h" #include "PinMapping.h"
#include "MessageOutput.h" #include "MessageOutput.h"
@@ -30,11 +30,11 @@
#endif #endif
#ifndef LED0 #ifndef LED0
#define LED0 -1 #define LED0 GPIO_NUM_NC
#endif #endif
#ifndef LED1 #ifndef LED1
#define LED1 -1 #define LED1 GPIO_NUM_NC
#endif #endif
#ifndef HOYMILES_PIN_SCLK #ifndef HOYMILES_PIN_SCLK