From 852c42a8f324b50638c593f017314b5031958394 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 20 Jul 2023 16:34:13 -0300 Subject: [PATCH] static clue --- .../stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c | 8 +++++--- .../stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c b/examples/stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c index b93e203364..1531a3ec43 100644 --- a/examples/stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c +++ b/examples/stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c @@ -461,10 +461,12 @@ void server(void *argument) mg_log_set(MG_LL_DEBUG); // Set log level // Initialise Mongoose network stack - // Specify MAC address, and IP/mask/GW in network byte order for static - // IP configuration. If IP/mask/GW are unset, DHCP is going to be used struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4}; - struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(), + struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(), + // Uncomment below for static configuration: + // .ip = mg_htonl(MG_U32(192, 168, 0, 223)), + // .mask = mg_htonl(MG_U32(255, 255, 255, 0)), + // .gw = mg_htonl(MG_U32(192, 168, 0, 1)), .driver = &mg_tcpip_driver_stm32, .driver_data = &driver_data}; mg_tcpip_init(&mgr, &mif); diff --git a/examples/stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c b/examples/stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c index 94118d295b..a14ad33435 100644 --- a/examples/stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c +++ b/examples/stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c @@ -477,10 +477,12 @@ void server(void *argument) mg_log_set(MG_LL_DEBUG); // Set log level // Initialise Mongoose network stack - // Specify MAC address, and IP/mask/GW in network byte order for static - // IP configuration. If IP/mask/GW are unset, DHCP is going to be used struct mg_tcpip_driver_stm32_data driver_data = {.mdc_cr = 4}; - struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(), + struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(), + // Uncomment below for static configuration: + // .ip = mg_htonl(MG_U32(192, 168, 0, 223)), + // .mask = mg_htonl(MG_U32(255, 255, 255, 0)), + // .gw = mg_htonl(MG_U32(192, 168, 0, 1)), .driver = &mg_tcpip_driver_stm32, .driver_data = &driver_data}; mg_tcpip_init(&mgr, &mif);