From 212585684ef68c48edc7d23416ff601109fe0e28 Mon Sep 17 00:00:00 2001 From: cpq Date: Tue, 7 Apr 2026 15:31:40 +0100 Subject: [PATCH] Fix MG_ENABLE_ETH_IRQ --- mongoose.h | 10 ++++++---- src/drivers/stm32f.h | 4 ++-- src/drivers/stm32h.h | 6 ++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mongoose.h b/mongoose.h index b07dd55e..5061f2b3 100644 --- a/mongoose.h +++ b/mongoose.h @@ -3876,9 +3876,9 @@ struct mg_tcpip_driver_stm32f_data { #define MG_DRIVER_MDC_CR 4 #endif -#if MG_ARCH == MG_ARCH_CUBE +#if MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH_IRQn) -#else +#elif !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() #endif @@ -3945,9 +3945,11 @@ struct mg_tcpip_driver_stm32h_data { #define MG_DRIVER_MDC_CR 4 #endif -#if MG_ENABLE_DRIVER_STM32H && MG_ARCH == MG_ARCH_CUBE +#if MG_ENABLE_DRIVER_STM32H && MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH_IRQn) -#else +#elif MG_ENABLE_DRIVER_STM32N && MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) +#define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH1_IRQn) +#elif !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() #endif diff --git a/src/drivers/stm32f.h b/src/drivers/stm32f.h index fa712855..1adff507 100644 --- a/src/drivers/stm32f.h +++ b/src/drivers/stm32f.h @@ -28,9 +28,9 @@ struct mg_tcpip_driver_stm32f_data { #define MG_DRIVER_MDC_CR 4 #endif -#if MG_ARCH == MG_ARCH_CUBE +#if MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH_IRQn) -#else +#elif !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() #endif diff --git a/src/drivers/stm32h.h b/src/drivers/stm32h.h index a732ba1f..7dd5eea7 100644 --- a/src/drivers/stm32h.h +++ b/src/drivers/stm32h.h @@ -43,9 +43,11 @@ struct mg_tcpip_driver_stm32h_data { #define MG_DRIVER_MDC_CR 4 #endif -#if MG_ENABLE_DRIVER_STM32H && MG_ARCH == MG_ARCH_CUBE +#if MG_ENABLE_DRIVER_STM32H && MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH_IRQn) -#else +#elif MG_ENABLE_DRIVER_STM32N && MG_ARCH == MG_ARCH_CUBE && !defined(MG_ENABLE_ETH_IRQ) +#define MG_ENABLE_ETH_IRQ() NVIC_EnableIRQ(ETH1_IRQn) +#elif !defined(MG_ENABLE_ETH_IRQ) #define MG_ENABLE_ETH_IRQ() #endif