diff --git a/avrpins_8h_source.html b/avrpins_8h_source.html index 1164cf32..b1d2dab8 100644 --- a/avrpins_8h_source.html +++ b/avrpins_8h_source.html @@ -1482,84 +1482,104 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
1395 
1396 #if defined(ESP8266)
1397 
-
1398 // Pinout for ESP-12 module
-
1399 // 0 .. 16 - Digital pins
-
1400 // GPIO 6 to 11 and 16 are not usable in this library.
-
1401 
-
1402 MAKE_PIN(P0, 0);
-
1403 MAKE_PIN(P1, 1); // TX0
-
1404 MAKE_PIN(P2, 2); // TX1
-
1405 MAKE_PIN(P3, 3); // RX0
-
1406 MAKE_PIN(P4, 4); // SDA
-
1407 MAKE_PIN(P5, 5); // SCL
-
1408 MAKE_PIN(P12, 12); // MISO
-
1409 MAKE_PIN(P13, 13); // MOSI
-
1410 MAKE_PIN(P14, 14); // SCK
-
1411 MAKE_PIN(P15, 15); // SS
-
1412 
-
1413 #elif defined(ESP32)
-
1414 
-
1415 // Workaround strict-aliasing warnings
-
1416 #ifdef pgm_read_word
-
1417 #undef pgm_read_word
-
1418 #endif
-
1419 #ifdef pgm_read_dword
-
1420 #undef pgm_read_dword
-
1421 #endif
-
1422 #ifdef pgm_read_float
-
1423 #undef pgm_read_float
-
1424 #endif
-
1425 #ifdef pgm_read_ptr
-
1426 #undef pgm_read_ptr
-
1427 #endif
-
1428 
-
1429 #define pgm_read_word(addr) ({ \
-
1430  typeof(addr) _addr = (addr); \
-
1431  *(const unsigned short *)(_addr); \
-
1432 })
-
1433 #define pgm_read_dword(addr) ({ \
-
1434  typeof(addr) _addr = (addr); \
-
1435  *(const unsigned long *)(_addr); \
-
1436 })
-
1437 #define pgm_read_float(addr) ({ \
-
1438  typeof(addr) _addr = (addr); \
-
1439  *(const float *)(_addr); \
-
1440 })
-
1441 #define pgm_read_ptr(addr) ({ \
-
1442  typeof(addr) _addr = (addr); \
-
1443  *(void * const *)(_addr); \
-
1444 })
-
1445 
-
1446 // Pinout for ESP32 dev module
-
1447 
-
1448 MAKE_PIN(P0, 0);
-
1449 MAKE_PIN(P1, 1); // TX0
-
1450 MAKE_PIN(P10, 10); // TX1
-
1451 MAKE_PIN(P3, 3); // RX0
-
1452 MAKE_PIN(P21, 21); // SDA
-
1453 MAKE_PIN(P22, 22); // SCL
-
1454 MAKE_PIN(P19, 19); // MISO
-
1455 MAKE_PIN(P23, 23); // MOSI
-
1456 MAKE_PIN(P18, 18); // SCK
-
1457 MAKE_PIN(P5, 5); // SS
-
1458 MAKE_PIN(P17, 17); // INT
-
1459 
-
1460 #endif
-
1461 
-
1462 #undef MAKE_PIN
-
1463 
-
1464 // pgm_read_ptr is not defined in the ESP32, so we have to undef the diffinition from version_helper.h
-
1465 #ifdef pgm_read_pointer
-
1466 #undef pgm_read_pointer
-
1467 #endif
-
1468 #define pgm_read_pointer(p) pgm_read_ptr(p)
-
1469 
-
1470 #else
-
1471 #error "Please define board in avrpins.h"
-
1472 
-
1473 #endif
-
1474 
-
1475 #endif //_avrpins_h_
+
1398 // Workaround the following issue: https://github.com/esp8266/Arduino/pull/5735
+
1399 #undef pgm_read_ptr_aligned
+
1400 #ifdef __cplusplus
+
1401 #define pgm_read_ptr_aligned(addr) (*reinterpret_cast<const void* const*>(addr))
+
1402 #else
+
1403 #define pgm_read_ptr_aligned(addr) (*(const void* const*)(addr))
+
1404 #endif
+
1405 
+
1406 #undef pgm_read_ptr
+
1407 #if PGM_READ_UNALIGNED
+
1408 #define pgm_read_ptr(p) pgm_read_ptr_unaligned(p)
+
1409 #else
+
1410 #define pgm_read_ptr(p) pgm_read_ptr_aligned(p)
+
1411 #endif
+
1412 
+
1413 #ifdef pgm_read_pointer
+
1414 #undef pgm_read_pointer
+
1415 #endif
+
1416 #define pgm_read_pointer(p) pgm_read_ptr(p)
+
1417 
+
1418 // Pinout for ESP-12 module
+
1419 // 0 .. 16 - Digital pins
+
1420 // GPIO 6 to 11 and 16 are not usable in this library.
+
1421 
+
1422 MAKE_PIN(P0, 0);
+
1423 MAKE_PIN(P1, 1); // TX0
+
1424 MAKE_PIN(P2, 2); // TX1
+
1425 MAKE_PIN(P3, 3); // RX0
+
1426 MAKE_PIN(P4, 4); // SDA
+
1427 MAKE_PIN(P5, 5); // SCL
+
1428 MAKE_PIN(P12, 12); // MISO
+
1429 MAKE_PIN(P13, 13); // MOSI
+
1430 MAKE_PIN(P14, 14); // SCK
+
1431 MAKE_PIN(P15, 15); // SS
+
1432 
+
1433 #elif defined(ESP32)
+
1434 
+
1435 // Workaround strict-aliasing warnings
+
1436 #ifdef pgm_read_word
+
1437 #undef pgm_read_word
+
1438 #endif
+
1439 #ifdef pgm_read_dword
+
1440 #undef pgm_read_dword
+
1441 #endif
+
1442 #ifdef pgm_read_float
+
1443 #undef pgm_read_float
+
1444 #endif
+
1445 #ifdef pgm_read_ptr
+
1446 #undef pgm_read_ptr
+
1447 #endif
+
1448 
+
1449 #define pgm_read_word(addr) ({ \
+
1450  typeof(addr) _addr = (addr); \
+
1451  *(const unsigned short *)(_addr); \
+
1452 })
+
1453 #define pgm_read_dword(addr) ({ \
+
1454  typeof(addr) _addr = (addr); \
+
1455  *(const unsigned long *)(_addr); \
+
1456 })
+
1457 #define pgm_read_float(addr) ({ \
+
1458  typeof(addr) _addr = (addr); \
+
1459  *(const float *)(_addr); \
+
1460 })
+
1461 #define pgm_read_ptr(addr) ({ \
+
1462  typeof(addr) _addr = (addr); \
+
1463  *(void * const *)(_addr); \
+
1464 })
+
1465 
+
1466 // Pinout for ESP32 dev module
+
1467 
+
1468 MAKE_PIN(P0, 0);
+
1469 MAKE_PIN(P1, 1); // TX0
+
1470 MAKE_PIN(P10, 10); // TX1
+
1471 MAKE_PIN(P3, 3); // RX0
+
1472 MAKE_PIN(P21, 21); // SDA
+
1473 MAKE_PIN(P22, 22); // SCL
+
1474 MAKE_PIN(P19, 19); // MISO
+
1475 MAKE_PIN(P23, 23); // MOSI
+
1476 MAKE_PIN(P18, 18); // SCK
+
1477 MAKE_PIN(P5, 5); // SS
+
1478 MAKE_PIN(P17, 17); // INT
+
1479 
+
1480 #endif
+
1481 
+
1482 #undef MAKE_PIN
+
1483 
+
1484 // pgm_read_ptr is not defined in the ESP32, so we have to undef the diffinition from version_helper.h
+
1485 #ifdef pgm_read_pointer
+
1486 #undef pgm_read_pointer
+
1487 #endif
+
1488 #define pgm_read_pointer(p) pgm_read_ptr(p)
+
1489 
+
1490 #else
+
1491 #error "Please define board in avrpins.h"
+
1492 
+
1493 #endif
+
1494 
+
1495 #endif //_avrpins_h_