diff --git a/cores/esp32/apps/sntp/sntp.h b/cores/esp32/apps/sntp/sntp.h new file mode 100644 index 00000000000..8a940f88076 --- /dev/null +++ b/cores/esp32/apps/sntp/sntp.h @@ -0,0 +1 @@ +#include "lwip/apps/sntp.h" diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c index 176ac65cc2f..1d171f27722 100644 --- a/cores/esp32/esp32-hal-time.c +++ b/cores/esp32/esp32-hal-time.c @@ -13,7 +13,7 @@ // limitations under the License. #include "esp32-hal.h" -#include "apps/sntp/sntp.h" +#include "lwip/apps/sntp.h" static void setTimeZone(long offset, int daylight) { diff --git a/libraries/AsyncUDP/src/AsyncUDP.cpp b/libraries/AsyncUDP/src/AsyncUDP.cpp index 6fff201a9bd..bce776899f6 100644 --- a/libraries/AsyncUDP/src/AsyncUDP.cpp +++ b/libraries/AsyncUDP/src/AsyncUDP.cpp @@ -15,7 +15,7 @@ extern "C" { #include "lwip/priv/tcpip_priv.h" typedef struct { - struct tcpip_api_call call; + struct tcpip_api_call_data call; udp_pcb * pcb; const ip_addr_t *addr; uint16_t port; @@ -24,7 +24,7 @@ typedef struct { err_t err; } udp_api_call_t; -static err_t _udp_connect_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_connect_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = udp_connect(msg->pcb, msg->addr, msg->port); return msg->err; @@ -35,11 +35,11 @@ static err_t _udp_connect(struct udp_pcb *pcb, const ip_addr_t *addr, u16_t port msg.pcb = pcb; msg.addr = addr; msg.port = port; - tcpip_api_call(_udp_connect_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_connect_api, (struct tcpip_api_call_data*)&msg); return msg.err; } -static err_t _udp_disconnect_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_disconnect_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = 0; udp_disconnect(msg->pcb); @@ -49,10 +49,10 @@ static err_t _udp_disconnect_api(struct tcpip_api_call *api_call_msg){ static void _udp_disconnect(struct udp_pcb *pcb){ udp_api_call_t msg; msg.pcb = pcb; - tcpip_api_call(_udp_disconnect_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_disconnect_api, (struct tcpip_api_call_data*)&msg); } -static err_t _udp_remove_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_remove_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = 0; udp_remove(msg->pcb); @@ -62,10 +62,10 @@ static err_t _udp_remove_api(struct tcpip_api_call *api_call_msg){ static void _udp_remove(struct udp_pcb *pcb){ udp_api_call_t msg; msg.pcb = pcb; - tcpip_api_call(_udp_remove_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_remove_api, (struct tcpip_api_call_data*)&msg); } -static err_t _udp_bind_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_bind_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = udp_bind(msg->pcb, msg->addr, msg->port); return msg->err; @@ -76,11 +76,11 @@ static err_t _udp_bind(struct udp_pcb *pcb, const ip_addr_t *addr, u16_t port){ msg.pcb = pcb; msg.addr = addr; msg.port = port; - tcpip_api_call(_udp_bind_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_bind_api, (struct tcpip_api_call_data*)&msg); return msg.err; } -static err_t _udp_sendto_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_sendto_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = udp_sendto(msg->pcb, msg->pb, msg->addr, msg->port); return msg->err; @@ -92,11 +92,11 @@ static err_t _udp_sendto(struct udp_pcb *pcb, struct pbuf *pb, const ip_addr_t * msg.addr = addr; msg.port = port; msg.pb = pb; - tcpip_api_call(_udp_sendto_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_sendto_api, (struct tcpip_api_call_data*)&msg); return msg.err; } -static err_t _udp_sendto_if_api(struct tcpip_api_call *api_call_msg){ +static err_t _udp_sendto_if_api(struct tcpip_api_call_data *api_call_msg){ udp_api_call_t * msg = (udp_api_call_t *)api_call_msg; msg->err = udp_sendto_if(msg->pcb, msg->pb, msg->addr, msg->port, msg->netif); return msg->err; @@ -109,7 +109,7 @@ static err_t _udp_sendto_if(struct udp_pcb *pcb, struct pbuf *pb, const ip_addr_ msg.port = port; msg.pb = pb; msg.netif = netif; - tcpip_api_call(_udp_sendto_if_api, (struct tcpip_api_call*)&msg); + tcpip_api_call(_udp_sendto_if_api, (struct tcpip_api_call_data*)&msg); return msg.err; } @@ -452,16 +452,24 @@ size_t AsyncUDPPacket::send(AsyncUDPMessage &message) return write(message.data(), message.length()); } -AsyncUDP::AsyncUDP() -{ +bool AsyncUDP::_init(){ + if(_pcb){ + return true; + } _pcb = udp_new(); - _connected = false; - _handler = NULL; if(!_pcb){ - return; + return false; } //_lock = xSemaphoreCreateMutex(); udp_recv(_pcb, &_udp_recv, (void *) this); + return true; +} + +AsyncUDP::AsyncUDP() +{ + _pcb = NULL; + _connected = false; + _handler = NULL; } AsyncUDP::~AsyncUDP() @@ -495,7 +503,7 @@ bool AsyncUDP::connect(const ip_addr_t *addr, uint16_t port) log_e("failed to start task"); return false; } - if(_pcb == NULL) { + if(!_init()) { return false; } close(); @@ -516,7 +524,7 @@ bool AsyncUDP::listen(const ip_addr_t *addr, uint16_t port) log_e("failed to start task"); return false; } - if(_pcb == NULL) { + if(!_init()) { return false; } close(); diff --git a/libraries/AsyncUDP/src/AsyncUDP.h b/libraries/AsyncUDP/src/AsyncUDP.h index f97381cab57..993fa1084a5 100644 --- a/libraries/AsyncUDP/src/AsyncUDP.h +++ b/libraries/AsyncUDP/src/AsyncUDP.h @@ -95,6 +95,7 @@ class AsyncUDP : public Print bool _connected; AuPacketHandlerFunction _handler; + bool _init(); void _recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port, struct netif * netif); public: diff --git a/libraries/SD_MMC/src/SD_MMC.cpp b/libraries/SD_MMC/src/SD_MMC.cpp index 2f36eee7e42..4de467304e5 100644 --- a/libraries/SD_MMC/src/SD_MMC.cpp +++ b/libraries/SD_MMC/src/SD_MMC.cpp @@ -50,12 +50,13 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit) .init = &sdmmc_host_init, .set_bus_width = &sdmmc_host_set_bus_width, .get_bus_width = &sdmmc_host_get_slot_width, + .set_bus_ddr_mode = &sdmmc_host_set_bus_ddr_mode, .set_card_clk = &sdmmc_host_set_card_clk, .do_transaction = &sdmmc_host_do_transaction, .deinit = &sdmmc_host_deinit, - .io_int_enable = sdmmc_host_io_int_enable, - .io_int_wait = sdmmc_host_io_int_wait, - .command_timeout_ms = 0, + .io_int_enable = &sdmmc_host_io_int_enable, + .io_int_wait = &sdmmc_host_io_int_wait, + .command_timeout_ms = 0 }; host.max_freq_khz = SDMMC_FREQ_HIGHSPEED; #ifdef BOARD_HAS_1BIT_SDMMC diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index f4a2fa54493..8f96add91bc 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -37,7 +37,7 @@ extern "C" { #include #include #include -#include "apps/dhcpserver_options.h" +#include "dhcpserver/dhcpserver_options.h" }