Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
1e4bf14a
Commit
1e4bf14a
authored
Sep 17, 2018
by
Junxiao Shi
Committed by
Me No Dev
Sep 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cores: replace max, min, round macros with imports from std (#1783)
fixes #1734
parent
f9f995b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
17 deletions
+12
-17
cores/esp32/Arduino.h
cores/esp32/Arduino.h
+9
-7
libraries/WiFi/src/WiFiClient.h
libraries/WiFi/src/WiFiClient.h
+0
-2
libraries/WiFi/src/WiFiGeneric.cpp
libraries/WiFi/src/WiFiGeneric.cpp
+3
-6
libraries/WiFi/src/WiFiMulti.h
libraries/WiFi/src/WiFiMulti.h
+0
-2
No files found.
cores/esp32/Arduino.h
View file @
1e4bf14a
...
...
@@ -75,7 +75,6 @@
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))
...
...
@@ -146,6 +145,9 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
#ifdef __cplusplus
}
#include <algorithm>
#include <cmath>
#include "WCharacter.h"
#include "WString.h"
#include "Stream.h"
...
...
@@ -158,6 +160,12 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
#include "HardwareSerial.h"
#include "Esp.h"
using
std
::
isinf
;
using
std
::
isnan
;
using
std
::
max
;
using
std
::
min
;
using
::
round
;
uint16_t
makeWord
(
uint16_t
w
);
uint16_t
makeWord
(
byte
h
,
byte
l
);
...
...
@@ -176,12 +184,6 @@ extern "C" void configTzTime(const char* tz,
long
random
(
long
);
#endif
/* __cplusplus */
#ifndef _GLIBCXX_VECTOR
// arduino is not compatible with std::vector
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#endif
#define _min(a,b) ((a)<(b)?(a):(b))
#define _max(a,b) ((a)>(b)?(a):(b))
...
...
libraries/WiFi/src/WiFiClient.h
View file @
1e4bf14a
...
...
@@ -23,8 +23,6 @@
#include "Arduino.h"
#include "Client.h"
#undef min
#undef max
#include <memory>
class
WiFiClientSocketHandle
;
...
...
libraries/WiFi/src/WiFiGeneric.cpp
View file @
1e4bf14a
...
...
@@ -46,9 +46,6 @@ extern "C" {
}
//extern "C"
#include "esp32-hal-log.h"
#undef min
#undef max
#include <vector>
#include "sdkconfig.h"
...
...
@@ -156,8 +153,8 @@ static bool espWiFiStart(bool persistent){
return
false
;
}
_esp_wifi_started
=
true
;
system_event_t
event
;
event
.
event_id
=
SYSTEM_EVENT_WIFI_READY
;
system_event_t
event
;
event
.
event_id
=
SYSTEM_EVENT_WIFI_READY
;
WiFiGenericClass
::
_eventCallback
(
nullptr
,
&
event
);
return
true
;
...
...
@@ -496,7 +493,7 @@ bool WiFiGenericClass::mode(wifi_mode_t m)
}
else
if
(
cm
&&
!
m
){
return
espWiFiStop
();
}
esp_err_t
err
;
err
=
esp_wifi_set_mode
(
m
);
if
(
err
){
...
...
libraries/WiFi/src/WiFiMulti.h
View file @
1e4bf14a
...
...
@@ -27,8 +27,6 @@
#define WIFICLIENTMULTI_H_
#include "WiFi.h"
#undef min
#undef max
#include <vector>
typedef
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment