mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Moved the macros into avrpins instead, as we need to redefine pgm_read_ptr as well
This commit is contained in:
parent
b3fa5718d5
commit
db33d38c44
2 changed files with 20 additions and 10 deletions
20
avrpins.h
20
avrpins.h
|
@ -1395,6 +1395,26 @@ public: \
|
|||
|
||||
#if defined(ESP8266)
|
||||
|
||||
// Workaround the following issue: https://github.com/esp8266/Arduino/pull/5735
|
||||
#undef pgm_read_ptr_aligned
|
||||
#ifdef __cplusplus
|
||||
#define pgm_read_ptr_aligned(addr) (*reinterpret_cast<const void* const*>(addr))
|
||||
#else
|
||||
#define pgm_read_ptr_aligned(addr) (*(const void* const*)(addr))
|
||||
#endif
|
||||
|
||||
#undef pgm_read_ptr
|
||||
#if PGM_READ_UNALIGNED
|
||||
#define pgm_read_ptr(p) pgm_read_ptr_unaligned(p)
|
||||
#else
|
||||
#define pgm_read_ptr(p) pgm_read_ptr_aligned(p)
|
||||
#endif
|
||||
|
||||
#ifdef pgm_read_pointer
|
||||
#undef pgm_read_pointer
|
||||
#endif
|
||||
#define pgm_read_pointer(p) pgm_read_ptr(p)
|
||||
|
||||
// Pinout for ESP-12 module
|
||||
// 0 .. 16 - Digital pins
|
||||
// GPIO 6 to 11 and 16 are not usable in this library.
|
||||
|
|
|
@ -157,16 +157,6 @@ e-mail : support@circuitsathome.com
|
|||
#define fprintf_P(s, ...) ((s), __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef ESP8266
|
||||
// Workaround the following issue: https://github.com/esp8266/Arduino/pull/5735
|
||||
#undef pgm_read_ptr_aligned
|
||||
#ifdef __cplusplus
|
||||
#define pgm_read_ptr_aligned(addr) (*reinterpret_cast<const void* const*>(addr))
|
||||
#else
|
||||
#define pgm_read_ptr_aligned(addr) (*(const void* const*)(addr))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef pgm_read_byte
|
||||
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue