56 #if IS_ACTIVE(HAS_FLASH_UTILS_ARCH)
68 #define FLASH_ATTR <IMPLEMTATION_DEFINED>
80 #define PRIsflash <IMPLEMTATION_DEFINED>
91 #define TO_FLASH(str_literal) <IMPLEMTATION_DEFINED>
211 #elif !IS_ACTIVE(HAS_FLASH_UTILS_ARCH)
213 # define PRIsflash "s"
214 # define ASSERT_IS_STR_LITERAL_HELPER(x) x
215 # define ASSERT_IS_STR_LITERAL(x) ASSERT_IS_STR_LITERAL_HELPER("" x)
216 # define TO_FLASH(x) ASSERT_IS_STR_LITERAL(x)
217 # define flash_strcmp strcmp
218 # define flash_strncmp strncmp
219 # define flash_strlen strlen
220 # define flash_strcpy strcpy
221 # define flash_strncpy strncpy
222 # define flash_printf printf
223 # define flash_vprintf vprintf
224 # define flash_fprintf fprintf
225 # define flash_vfprintf vfprintf
226 # define flash_snprintf snprintf
227 # define flash_vsnprintf vsnprintf
228 # define flash_puts puts
229 # define flash_memcpy memcpy
240 #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.
stdio wrapper to extend the C libs stdio