1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

remove lwip-v1.4 specific code (#7436)

* remove lwip-v1.4 specific code

* ditto

* ditto

* fix ip4_addr definition

* CI: change debug builds to use IPv6, remove regular IPv6 builds

* ditto

* split pio CI in four (because they last twice the time of the other builds)

* remove option from pio

* remove lwIP-1.4 from doc

* restore pio CI splitting

* fix CI debug6 script

* ditto
This commit is contained in:
david gauchard
2020-07-09 18:59:49 +02:00
committed by GitHub
parent 70e4457041
commit af1bc71a9e
135 changed files with 49 additions and 47073 deletions

View File

@ -128,7 +128,7 @@ struct netifWrapper
const char* ifmac () const { return (const char*)_netif->hwaddr; }
int ifnumber () const { return _netif->num; }
bool ifUp () const { return !!(_netif->flags & NETIF_FLAG_UP); }
CONST netif* interface () const { return _netif; }
const netif* interface () const { return _netif; }
const ip_addr_t* ipFromNetifNum () const
{

View File

@ -42,11 +42,9 @@ class Client: public Stream {
uint8_t* rawIPAddress(IPAddress& addr) {
return addr.raw_address();
}
#if LWIP_VERSION_MAJOR != 1
const uint8_t* rawIPAddress(const IPAddress& addr) {
return addr.raw_address();
}
#endif
};
#endif

View File

@ -21,7 +21,6 @@
#include <Arduino.h>
#include <user_interface.h>
#include <core_version.h>
#include <lwip/init.h> // LWIP_VERSION_*
#include <lwipopts.h> // LWIP_HASH_STR (lwip2)
#include <bearssl/bearssl_git.h> // BEARSSL_GIT short hash
@ -29,13 +28,11 @@
#define STR(x) STRHELPER(x) // stringifier
static const char arduino_esp8266_git_ver [] PROGMEM = "/Core:" STR(ARDUINO_ESP8266_GIT_DESC) "=";
#if LWIP_VERSION_MAJOR > 1
#if LWIP_IPV6
static const char lwip_version [] PROGMEM = "/lwIP:IPv6+" LWIP_HASH_STR;
#else
static const char lwip_version [] PROGMEM = "/lwIP:" LWIP_HASH_STR;
#endif
#endif
static const char bearssl_version [] PROGMEM = "/BearSSL:" STR(BEARSSL_GIT);
String EspClass::getFullVersion() {
@ -45,23 +42,7 @@ String EspClass::getFullVersion() {
s += system_get_sdk_version();
s += FPSTR(arduino_esp8266_git_ver);
s += String(esp8266::coreVersionNumeric());
#if LWIP_VERSION_MAJOR == 1
s += F("/lwIP:");
s += LWIP_VERSION_MAJOR;
s += '.';
s += LWIP_VERSION_MINOR;
s += '.';
s += LWIP_VERSION_REVISION;
#if LWIP_VERSION_IS_DEVELOPMENT
s += F("-dev");
#endif
#if LWIP_VERSION_IS_RC
s += F("rc");
s += String(LWIP_VERSION_RC);
#endif
#else // LWIP_VERSION_MAJOR != 1
s += FPSTR(lwip_version);
#endif // LWIP_VERSION_MAJOR != 1
s += FPSTR(bearssl_version);
return s;

View File

@ -180,7 +180,7 @@ bool IPAddress::isValid(const char* arg) {
return IPAddress().fromString(arg);
}
CONST IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6
const IPAddress INADDR_ANY; // generic "0.0.0.0" for IPv4 & IPv6
const IPAddress INADDR_NONE(255,255,255,255);
/**************************************/

View File

@ -26,28 +26,11 @@
#include <lwip/init.h>
#include <lwip/ip_addr.h>
#include <lwip/ip4_addr.h>
#if LWIP_VERSION_MAJOR == 1
// compatibility macros to make lwIP-v1 compiling lwIP-v2 API
#define LWIP_IPV6_NUM_ADDRESSES 0
#define ip_2_ip4(x) (x)
#define ipv4_addr ip_addr
#define ipv4_addr_t ip_addr_t
#define IP_IS_V4_VAL(x) (1)
#define IP_SET_TYPE_VAL(x,y) do { (void)0; } while (0)
#define IP_ANY_TYPE (&ip_addr_any)
#define IP4_ADDR_ANY IPADDR_ANY
#define IP4_ADDR_ANY4 IP_ADDR_ANY
#define IPADDR4_INIT(x) { x }
#define CONST /* nothing: lwIP-v1 does not use const */
#define ip4_addr_netcmp ip_addr_netcmp
#define netif_dhcp_data(netif) ((netif)->dhcp)
#else // lwIP-v2+
#define CONST const
#if !LWIP_IPV6
struct ip_addr: ipv4_addr { };
#endif // !LWIP_IPV6
#endif // lwIP-v2+
// A class to make it easier to handle and pass around IP addresses
// IPv6 update:
@ -220,7 +203,7 @@ class IPAddress: public Printable {
};
extern CONST IPAddress INADDR_ANY;
extern const IPAddress INADDR_ANY;
extern const IPAddress INADDR_NONE;
#endif

View File

@ -83,14 +83,14 @@ class UDP: public Stream {
// Return the port of the host who sent the current incoming packet
virtual uint16_t remotePort() =0;
protected:
uint8_t* rawIPAddress(IPAddress& addr) {
return addr.raw_address();
}
#if LWIP_VERSION_MAJOR != 1
const uint8_t* rawIPAddress(const IPAddress& addr) {
return addr.raw_address();
}
#endif
};
#endif

View File

@ -60,44 +60,6 @@ void settimeofday_cb (const TrivialCB& cb)
extern "C" {
#if LWIP_VERSION_MAJOR == 1
#include <pgmspace.h>
static const char stod14[] PROGMEM = "settimeofday() can't set time!\n";
bool sntp_set_timezone(sint8 timezone);
bool sntp_set_timezone_in_seconds(int32_t timezone)
{
return sntp_set_timezone((sint8)(timezone/(60*60))); //TODO: move this to the same file as sntp_set_timezone() in lwip1.4, and implement correctly over there.
}
void sntp_set_daylight(int daylight);
int settimeofday(const struct timeval* tv, const struct timezone* tz)
{
if (tz) /*before*/
{
sntp_set_timezone_in_seconds(tz->tz_minuteswest * 60);
// apparently tz->tz_dsttime is a bitfield and should not be further used (cf man)
sntp_set_daylight(0);
}
if (tv) /* after*/
{
// can't call lwip1.4's static sntp_set_system_time()
os_printf(stod14);
// reset time subsystem
timeshift64_is_set = false;
return -1;
}
return 0;
}
#endif // lwip 1.4 only
#if LWIP_VERSION_MAJOR == 2
#include <lwip/apps/sntp.h>
uint32_t sntp_real_timestamp = 0;
@ -128,6 +90,4 @@ int settimeofday(const struct timeval* tv, const struct timezone* tz)
return 0;
}
#endif // lwip2 only
};

View File

@ -73,13 +73,6 @@ int clock_gettime(clockid_t unused, struct timespec *tp)
return 0;
}
#if LWIP_VERSION_MAJOR == 1
// hack for espressif time management included in patched lwIP-1.4
#define sntp_real_timestamp sntp_get_current_timestamp()
#endif
#if LWIP_VERSION_MAJOR != 1
// backport Espressif api
bool sntp_set_timezone_in_seconds (int32_t timezone_sec)
@ -103,8 +96,6 @@ uint32 sntp_get_current_timestamp()
return sntp_real_timestamp;
}
#endif
time_t time(time_t * t)
{
if (t)