diff --git a/mongoose.c b/mongoose.c index b1b4b669..246d82d3 100644 --- a/mongoose.c +++ b/mongoose.c @@ -22123,7 +22123,8 @@ bool mg_wifi_ap_stop(void) { #if MG_ENABLE_TCPIP && \ (defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10) || \ - (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) + (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) || \ + (defined(MG_ENABLE_DRIVER_MCXE) && MG_ENABLE_DRIVER_MCXE) struct imxrt_enet { volatile uint32_t RESERVED0, EIR, EIMR, RESERVED1, RDAR, TDAR, RESERVED2[3], ECR, RESERVED3[6], MMFR, MSCR, RESERVED4[7], MIBC, RESERVED5[7], RCR, @@ -22152,9 +22153,12 @@ struct imxrt_enet { #if defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11 #define ENET ((struct imxrt_enet *) (uintptr_t) 0x40424000U) #define ETH_DESC_CNT 5 // Descriptors count -#else +#elif defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10 #define ENET ((struct imxrt_enet *) (uintptr_t) 0x402D8000U) #define ETH_DESC_CNT 4 // Descriptors count +#else // MG_ENABLE_DRIVER_MCXE +#define ENET ((struct imxrt_enet *) (uintptr_t) 0x40079000U) +#define ETH_DESC_CNT 4 // Descriptor count #endif #define ETH_PKT_SIZE 1536 // Max frame size, 64-bit aligned @@ -22310,9 +22314,14 @@ static bool mg_tcpip_driver_imxrt_poll(struct mg_tcpip_if *ifp, bool s1) { return up; } -void ENET_IRQHandler(void); static uint32_t s_rxno; +#if !defined(MG_ENABLE_DRIVER_MCXE) +void ENET_IRQHandler(void); void ENET_IRQHandler(void) { +#else +void ENET_Receive_IRQHandler(void); +void ENET_Receive_IRQHandler(void) { +#endif ENET->EIR = MG_BIT(25); // Ack IRQ // Frame received, loop for (uint32_t i = 0; i < 10; i++) { // read as they arrive but not forever diff --git a/mongoose.h b/mongoose.h index 6197e3f3..2d2864bb 100644 --- a/mongoose.h +++ b/mongoose.h @@ -3234,7 +3234,8 @@ struct mg_tcpip_driver_cyw_data { #if MG_ENABLE_TCPIP && \ (defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10) || \ - (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) + (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) || \ + (defined(MG_ENABLE_DRIVER_MCXE) && MG_ENABLE_DRIVER_MCXE) struct mg_tcpip_driver_imxrt_data { // MDC clock divider. MDC clock is derived from IPS Bus clock (ipg_clk), diff --git a/src/drivers/imxrt.c b/src/drivers/imxrt.c index f1d95e1d..044670f5 100644 --- a/src/drivers/imxrt.c +++ b/src/drivers/imxrt.c @@ -2,7 +2,8 @@ #if MG_ENABLE_TCPIP && \ (defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10) || \ - (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) + (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) || \ + (defined(MG_ENABLE_DRIVER_MCXE) && MG_ENABLE_DRIVER_MCXE) struct imxrt_enet { volatile uint32_t RESERVED0, EIR, EIMR, RESERVED1, RDAR, TDAR, RESERVED2[3], ECR, RESERVED3[6], MMFR, MSCR, RESERVED4[7], MIBC, RESERVED5[7], RCR, @@ -31,9 +32,12 @@ struct imxrt_enet { #if defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11 #define ENET ((struct imxrt_enet *) (uintptr_t) 0x40424000U) #define ETH_DESC_CNT 5 // Descriptors count -#else +#elif defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10 #define ENET ((struct imxrt_enet *) (uintptr_t) 0x402D8000U) #define ETH_DESC_CNT 4 // Descriptors count +#else // MG_ENABLE_DRIVER_MCXE +#define ENET ((struct imxrt_enet *) (uintptr_t) 0x40079000U) +#define ETH_DESC_CNT 4 // Descriptor count #endif #define ETH_PKT_SIZE 1536 // Max frame size, 64-bit aligned @@ -189,9 +193,14 @@ static bool mg_tcpip_driver_imxrt_poll(struct mg_tcpip_if *ifp, bool s1) { return up; } -void ENET_IRQHandler(void); static uint32_t s_rxno; +#if !defined(MG_ENABLE_DRIVER_MCXE) +void ENET_IRQHandler(void); void ENET_IRQHandler(void) { +#else +void ENET_Receive_IRQHandler(void); +void ENET_Receive_IRQHandler(void) { +#endif ENET->EIR = MG_BIT(25); // Ack IRQ // Frame received, loop for (uint32_t i = 0; i < 10; i++) { // read as they arrive but not forever diff --git a/src/drivers/imxrt.h b/src/drivers/imxrt.h index 64600545..84690b8c 100644 --- a/src/drivers/imxrt.h +++ b/src/drivers/imxrt.h @@ -2,7 +2,8 @@ #if MG_ENABLE_TCPIP && \ (defined(MG_ENABLE_DRIVER_IMXRT10) && MG_ENABLE_DRIVER_IMXRT10) || \ - (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) + (defined(MG_ENABLE_DRIVER_IMXRT11) && MG_ENABLE_DRIVER_IMXRT11) || \ + (defined(MG_ENABLE_DRIVER_MCXE) && MG_ENABLE_DRIVER_MCXE) struct mg_tcpip_driver_imxrt_data { // MDC clock divider. MDC clock is derived from IPS Bus clock (ipg_clk),