mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d0b015217 |
No files matched your search
+15
-17
@@ -4842,6 +4842,7 @@ void mg_tcpip_arp_request(struct mg_tcpip_if *ifp, uint32_t ip, uint8_t *mac);
|
||||
// Built-in hardware drivers. Assign one to mg_tcpip_if.driver before calling
|
||||
// mg_tcpip_init(). Each driver also requires a corresponding driver_data
|
||||
// struct; see the matching driver header for details.
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_w5500;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_w5100;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_tm4c;
|
||||
@@ -4866,7 +4867,6 @@ extern struct mg_tcpip_driver mg_tcpip_driver_netc;
|
||||
|
||||
|
||||
|
||||
|
||||
// SPI bus abstraction for SPI-attached network chips (e.g. W5500).
|
||||
// Populate and assign to the driver's driver_data field.
|
||||
struct mg_tcpip_spi {
|
||||
@@ -5369,7 +5369,7 @@ struct mg_tcpip_driver_mcxw71_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_mcxw71;
|
||||
|
||||
#define MG_TCPIP_DRIVER_MCXW71_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_MCXW71_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_mcxw71_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -5377,9 +5377,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_mcxw71;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_mcxw71; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: mcxw71, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
@@ -5402,7 +5403,7 @@ struct mg_tcpip_driver_mg24_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_mg24;
|
||||
|
||||
#define MG_TCPIP_DRIVER_MG24_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_MG24_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_mg24_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -5410,9 +5411,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_mg24;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_mg24; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: mg24, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
@@ -5484,7 +5486,7 @@ struct mg_tcpip_driver_nrf52_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_nrf52;
|
||||
|
||||
#define MG_TCPIP_DRIVER_NRF52_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_NRF52_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_nrf52_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -5492,9 +5494,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_nrf52;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_nrf52; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: nrf52, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
@@ -5689,7 +5692,7 @@ struct mg_tcpip_driver_rw612w_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_rw612w;
|
||||
|
||||
#define MG_TCPIP_DRIVER_RW612W_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_RW612W_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_rw612w_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -5697,9 +5700,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_rw612w;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_rw612w; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: rw612w, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
@@ -5847,9 +5851,7 @@ struct mg_tcpip_driver_stm32f_data {
|
||||
#define MG_ENABLE_ETH_IRQ()
|
||||
#endif
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
|
||||
#define MG_TCPIP_DRIVER_STM32F_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_stm32f_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -5862,14 +5864,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
mif_.driver_data = &driver_data_; \
|
||||
MG_SET_MAC_ADDRESS(mif_.mac); \
|
||||
MG_ENABLE_ETH_IRQ(); \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init(mgr, &mif_); \
|
||||
MG_INFO(("Driver: stm32f, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#ifndef MG_TCPIP_DRIVER_INIT
|
||||
#define MG_TCPIP_DRIVER_INIT(x) MG_TCPIP_DRIVER_STM32F_INIT(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#if MG_ARCH == MG_ARCH_ARMGCC
|
||||
#ifndef _POSIX_TIMERS // Some newlib builds, e.g. Espressif's, define it
|
||||
#define _POSIX_TIMERS
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP
|
||||
|
||||
+7
-5
@@ -52,16 +52,18 @@
|
||||
#define MG_TLS MG_TLS_BUILTIN
|
||||
#endif
|
||||
|
||||
#if !defined(MG_OTA) && defined(STM32F1) || defined(STM32F2) || \
|
||||
defined(STM32F4) || defined(STM32F7)
|
||||
#ifndef MG_OTA // Pick OTA for the STM32 family, unless set by the user
|
||||
#if defined(STM32F1) || defined(STM32F2) || defined(STM32F4) || \
|
||||
defined(STM32F7)
|
||||
#define MG_OTA MG_OTA_STM32F
|
||||
#elif !defined(MG_OTA) && defined(STM32H5)
|
||||
#elif defined(STM32H5)
|
||||
#define MG_OTA MG_OTA_STM32H5
|
||||
#elif !defined(MG_OTA) && defined(STM32H7)
|
||||
#elif defined(STM32H7)
|
||||
#define MG_OTA MG_OTA_STM32H7
|
||||
#elif !defined(MG_OTA) && defined(STM32C5)
|
||||
#elif defined(STM32C5)
|
||||
#define MG_OTA MG_OTA_STM32C5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// use HAL-defined execute-in-ram section
|
||||
#ifndef MG_IRAM
|
||||
|
||||
@@ -13,7 +13,7 @@ struct mg_tcpip_driver_mcxw71_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_mcxw71;
|
||||
|
||||
#define MG_TCPIP_DRIVER_MCXW71_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_MCXW71_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_mcxw71_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -21,9 +21,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_mcxw71;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_mcxw71; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: mcxw71, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
+3
-2
@@ -12,7 +12,7 @@ struct mg_tcpip_driver_mg24_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_mg24;
|
||||
|
||||
#define MG_TCPIP_DRIVER_MG24_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_MG24_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_mg24_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -20,9 +20,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_mg24;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_mg24; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: mg24, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
+3
-2
@@ -12,7 +12,7 @@ struct mg_tcpip_driver_nrf52_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_nrf52;
|
||||
|
||||
#define MG_TCPIP_DRIVER_NRF52_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_NRF52_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_nrf52_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -20,9 +20,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_nrf52;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_nrf52; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: nrf52, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ struct mg_tcpip_driver_rw612w_data {
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_rw612w;
|
||||
|
||||
#define MG_TCPIP_DRIVER_RW612W_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_RW612W_INIT(manager) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_rw612w_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -21,9 +21,10 @@ extern struct mg_tcpip_driver mg_tcpip_driver_rw612w;
|
||||
mif_.ip = MG_TCPIP_IP; \
|
||||
mif_.mask = MG_TCPIP_MASK; \
|
||||
mif_.gw = MG_TCPIP_GW; \
|
||||
mif_.mgr = (manager); \
|
||||
mif_.driver = &mg_tcpip_driver_rw612w; \
|
||||
mif_.driver_data = &driver_data_; \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init((manager), &mif_); \
|
||||
MG_INFO(("Driver: rw612w, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@ struct mg_tcpip_driver_stm32f_data {
|
||||
#define MG_ENABLE_ETH_IRQ()
|
||||
#endif
|
||||
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
|
||||
#define MG_TCPIP_DRIVER_STM32F_INIT(mgr) \
|
||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||
do { \
|
||||
static struct mg_tcpip_driver_stm32f_data driver_data_; \
|
||||
static struct mg_tcpip_if mif_; \
|
||||
@@ -49,12 +47,8 @@ extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
mif_.driver_data = &driver_data_; \
|
||||
MG_SET_MAC_ADDRESS(mif_.mac); \
|
||||
MG_ENABLE_ETH_IRQ(); \
|
||||
mg_tcpip_init((mgr), &mif_); \
|
||||
mg_tcpip_init(mgr, &mif_); \
|
||||
MG_INFO(("Driver: stm32f, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||
} while (0)
|
||||
|
||||
#ifndef MG_TCPIP_DRIVER_INIT
|
||||
#define MG_TCPIP_DRIVER_INIT(x) MG_TCPIP_DRIVER_STM32F_INIT(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -135,6 +135,7 @@ void mg_tcpip_arp_request(struct mg_tcpip_if *ifp, uint32_t ip, uint8_t *mac);
|
||||
// Built-in hardware drivers. Assign one to mg_tcpip_if.driver before calling
|
||||
// mg_tcpip_init(). Each driver also requires a corresponding driver_data
|
||||
// struct; see the matching driver header for details.
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_stm32f;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_w5500;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_w5100;
|
||||
extern struct mg_tcpip_driver mg_tcpip_driver_tm4c;
|
||||
@@ -158,7 +159,6 @@ extern struct mg_tcpip_driver mg_tcpip_driver_netc;
|
||||
#include "drivers/mcxw71.h"
|
||||
#include "drivers/nrf52.h"
|
||||
#include "drivers/rw612w.h"
|
||||
#include "drivers/stm32f.h"
|
||||
|
||||
// SPI bus abstraction for SPI-attached network chips (e.g. W5500).
|
||||
// Populate and assign to the driver's driver_data field.
|
||||
|
||||
Reference in new issue
Block a user