diff --git a/cores/arduino/mik32/hal/peripherals/Include/mik32_hal_gpio.h b/cores/arduino/mik32/hal/peripherals/Include/mik32_hal_gpio.h index bc3237d..4d90b46 100644 --- a/cores/arduino/mik32/hal/peripherals/Include/mik32_hal_gpio.h +++ b/cores/arduino/mik32/hal/peripherals/Include/mik32_hal_gpio.h @@ -36,6 +36,7 @@ extern "C" { */ typedef enum __HAL_PinsTypeDef { + NOT_A_PIN = (0 << 0), /**< Не выбран пин. */ GPIO_PIN_0 = (1 << 0), /**< Выбран пин 0. */ GPIO_PIN_1 = (1 << 1), /**< Выбран пин 1. */ GPIO_PIN_2 = (1 << 2), /**< Выбран пин 2. */ diff --git a/libraries/NeoPixel/src/NeoPixel.cpp b/libraries/NeoPixel/src/NeoPixel.cpp index 11d00de..e2aabcc 100644 --- a/libraries/NeoPixel/src/NeoPixel.cpp +++ b/libraries/NeoPixel/src/NeoPixel.cpp @@ -65,7 +65,7 @@ static void __attribute__((noinline, section(".ram_text"))) mik32Show(GPIO_TypeD // not support 400khz if (!is800KHz) return; - if ((m_port != NULL) && (m_pin != NC)) + if ((m_port != NULL) && (m_pin != NOT_A_PIN)) { volatile uint32_t* set = &m_port->SET; volatile uint32_t* clr = &m_port->CLEAR;