mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Re-added lost function memcpy_P
This was lost in 80a5f29e89
I've also changed the type of src to PGM_VOID_P to match the other changes made in the above commit.
This commit is contained in:
parent
526aacfdc5
commit
572d88c1c4
@ -26,6 +26,18 @@ size_t strnlen_P(PGM_P s, size_t size) {
|
|||||||
return (size_t) (cp - s);
|
return (size_t) (cp - s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* memcpy_P(void* dest, PGM_VOID_P src, size_t count) {
|
||||||
|
const uint8_t* read = reinterpret_cast<const uint8_t*>(src);
|
||||||
|
uint8_t* write = reinterpret_cast<uint8_t*>(dest);
|
||||||
|
|
||||||
|
while (count)
|
||||||
|
{
|
||||||
|
*write++ = pgm_read_byte(read++);
|
||||||
|
count--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
int memcmp_P(const void* buf1, PGM_VOID_P buf2P, size_t size) {
|
int memcmp_P(const void* buf1, PGM_VOID_P buf2P, size_t size) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user