Skip to content

Commit

Permalink
static clue
Browse files Browse the repository at this point in the history
  • Loading branch information
scaprile committed Jul 20, 2023
1 parent 132725d commit 852c42a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions examples/stm32/nucleo-f429zi-cube-freertos/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions examples/stm32/nucleo-f746zg-cube-freertos/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 852c42a

Please sign in to comment.