Skip to content

Commit 6e4b207

Browse files
committed
Merge commit 'b879f800176d9de247babd55b47e594742c42a27' into develop
2 parents 584f6d9 + b879f80 commit 6e4b207

File tree

8 files changed

+34
-4
lines changed

8 files changed

+34
-4
lines changed

Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ menu "Arduino Configuration"
33
config ENABLE_ARDUINO_DEPENDS
44
bool
55
select LWIP_SO_RCVBUF
6-
select BT_ENABLED
76
select ETHERNET
87
select WIFI_ENABLED
98
select ESP32_PHY_CALIBRATION_AND_DATA_STORAGE

cores/esp32/Esp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,11 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
212212
{
213213
return spi_flash_read(offset, (uint32_t*) data, size) == ESP_OK;
214214
}
215+
216+
217+
uint64_t EspClass::getEfuseMac(void)
218+
{
219+
uint64_t _chipmacid;
220+
esp_efuse_read_mac((uint8_t*) (&_chipmacid));
221+
return _chipmacid;
222+
}

cores/esp32/Esp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class EspClass
7676
bool flashWrite(uint32_t offset, uint32_t *data, size_t size);
7777
bool flashRead(uint32_t offset, uint32_t *data, size_t size);
7878

79+
uint64_t getEfuseMac();
80+
7981
};
8082

8183
extern EspClass ESP;

cores/esp32/esp32-hal-bt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
#if CONFIG_BT_ENABLED
1415

1516
#include "esp32-hal-bt.h"
1617

@@ -62,5 +63,5 @@ bool btStop(){
6263
return false;
6364
}
6465

65-
66+
#endif
6667

cores/esp32/esp32-hal-bt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#include "esp32-hal.h"
1919

20+
#if CONFIG_BT_ENABLED
21+
2022
#ifdef __cplusplus
2123
extern "C" {
2224
#endif
@@ -29,4 +31,6 @@ bool btStop();
2931
}
3032
#endif
3133

34+
#endif
35+
3236
#endif /* _ESP32_ESP32_HAL_BT_H_ */

cores/esp32/esp32-hal-spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ void spiSetDataMode(spi_t * spi, uint8_t dataMode)
332332
break;
333333
case SPI_MODE2:
334334
spi->dev->pin.ck_idle_edge = 1;
335-
spi->dev->user.ck_out_edge = 0;
335+
spi->dev->user.ck_out_edge = 1;
336336
break;
337337
case SPI_MODE3:
338338
spi->dev->pin.ck_idle_edge = 1;
339-
spi->dev->user.ck_out_edge = 1;
339+
spi->dev->user.ck_out_edge = 0;
340340
break;
341341
case SPI_MODE0:
342342
default:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
uint64_t chipid;
2+
3+
void setup() {
4+
Serial.begin(115200);
5+
}
6+
7+
void loop() {
8+
chipid=ESP.getEfuseMac();//The chip ID is essentially its MAC address(length: 6 bytes).
9+
Serial.printf("ESP32 Chip ID = %04X",(uint16_t)(chipid>>32));//print High 2 bytes
10+
Serial.printf("%08X\n",(uint32_t)chipid);//print Low 4bytes.
11+
12+
delay(3000);
13+
14+
}

libraries/WiFi/src/WiFiClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
#include "Arduino.h"
2525
#include "Client.h"
26+
#undef min
27+
#undef max
2628
#include <memory>
2729

2830
class WiFiClientSocketHandle;

0 commit comments

Comments
 (0)