From e9c7f8de21950571afa2b17de043a0a5d555f047 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 26 Nov 2011 17:17:50 +1100 Subject: [PATCH] AP_Common: added typesafe wrapper for memcpy_P() --- libraries/AP_Common/AP_Common.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/AP_Common/AP_Common.h b/libraries/AP_Common/AP_Common.h index 2aa11ec7f6..0ffe4aea36 100644 --- a/libraries/AP_Common/AP_Common.h +++ b/libraries/AP_Common/AP_Common.h @@ -110,6 +110,11 @@ static inline size_t strlen_P(const prog_char_t *pstr) return strlen_P((const prog_char *)pstr); } +static inline void *memcpy_P(void *dest, const prog_char_t *src, size_t n) +{ + return memcpy_P(dest, (const prog_char *)src, n); +} + // strlcat_P() in AVR libc seems to be broken static inline size_t strlcat_P(char *d, const prog_char_t *s, size_t bufsize) {