55 #if IS_ACTIVE(HAS_FLASH_UTILS_ARCH) 
   67 #define FLASH_ATTR <IMPLEMTATION_DEFINED> 
   79 #define PRIsflash <IMPLEMTATION_DEFINED> 
   90 #define TO_FLASH(str_literal) <IMPLEMTATION_DEFINED> 
  210 #elif !IS_ACTIVE(HAS_FLASH_UTILS_ARCH) 
  212 #  define PRIsflash "s" 
  213 #  define ASSERT_IS_STR_LITERAL_HELPER(x) x 
  214 #  define ASSERT_IS_STR_LITERAL(x) ASSERT_IS_STR_LITERAL_HELPER("" x)
 
  215 #  define TO_FLASH(x) ASSERT_IS_STR_LITERAL(x) 
  216 #  define flash_strcmp strcmp 
  217 #  define flash_strncmp strncmp 
  218 #  define flash_strlen strlen 
  219 #  define flash_strcpy strcpy 
  220 #  define flash_strncpy strncpy 
  221 #  define flash_printf printf 
  222 #  define flash_vprintf vprintf 
  223 #  define flash_fprintf fprintf 
  224 #  define flash_vfprintf vfprintf 
  225 #  define flash_snprintf snprintf 
  226 #  define flash_vsnprintf vsnprintf 
  227 #  define flash_puts puts 
  228 #  define flash_memcpy memcpy 
  239 #define FLASH_PUTS(x) flash_puts(TO_FLASH(x)) 
Implementation of flash_utils.
 
#define printf(...)
A wrapper for the printf() function that passes arguments through unmodified, but fails to compile if...
 
#define PRIsflash
Format specifier for printing FLASH CONST char *
 
int flash_snprintf(char *buf, size_t buf_len, FLASH_ATTR const char *flash,...)
Like snprintf(), but the format string resides in flash.
 
int flash_vfprintf(FILE *stream, FLASH_ATTR const char *flash, va_list args)
Like vfprintf(), but the format string resides in flash.
 
char * flash_strncpy(char *ram, FLASH_ATTR const char *flash, size_t n)
Like strncpy(), but the source flash resides in flash.
 
char * flash_strcpy(char *ram, FLASH_ATTR const char *flash)
Like strcpy(), but the source flash resides in flash.
 
int flash_strncmp(const char *ram, FLASH_ATTR const char *flash, size_t n)
Like strncmp(), but the first string resides in flash.
 
#define FLASH_ATTR
C type qualifier required to place a variable in flash.
 
int flash_strcmp(const char *ram, FLASH_ATTR const char *flash)
Like strcmp(), but the second string resides in flash.
 
int flash_vprintf(FLASH_ATTR const char *flash, va_list args)
Like vprintf(), but the format string resides in flash.
 
void * flash_memcpy(void *dest, FLASH_ATTR const void *src, size_t n)
Like memcpy(), but src resides in flash.
 
int flash_fprintf(FILE *stream, FLASH_ATTR const char *flash,...)
Like fprintf(), but the format string resides in flash.
 
int flash_printf(FLASH_ATTR const char *flash,...)
Like printf(), but the format string resides in flash.
 
static void flash_print_str(FLASH_ATTR const char *flash)
Like flash_puts but without line break.
 
int flash_vsnprintf(char *buf, size_t buf_len, FLASH_ATTR const char *flash, va_list args)
Like vsnprintf(), but the format string resides in flash.
 
size_t flash_strlen(FLASH_ATTR const char *flash)
Like strlen(), but the string resides in flash.
 
void flash_puts(FLASH_ATTR const char *flash)
Like puts(), but the string resides in flash.
 
Common macros and compiler attributes/pragmas configuration.