From abfb601db6e6d80f90d99a23c3b12c6522d642f7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 May 2015 18:01:13 +1000 Subject: [PATCH] AP_Progmem: added pgm_read_block() --- libraries/AP_Progmem/AP_Progmem_AVR.h | 18 +++++++++--------- libraries/AP_Progmem/AP_Progmem_Identity.h | 6 ++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libraries/AP_Progmem/AP_Progmem_AVR.h b/libraries/AP_Progmem/AP_Progmem_AVR.h index 77906d43d6..d6fa76b241 100644 --- a/libraries/AP_Progmem/AP_Progmem_AVR.h +++ b/libraries/AP_Progmem/AP_Progmem_AVR.h @@ -56,6 +56,12 @@ static inline char *strncpy_P(char *buffer, const prog_char_t *pstr, size_t buff return strncpy_P(buffer, (const prog_char *)pstr, buffer_size); } +static inline void pgm_read_block(const void *s, void *dest, uint8_t len) { + uint8_t *dp = (uint8_t *)dest; + for (uint8_t i=0; i