feat(esp8266): Make os_printf equal to printf

Since the string used by printf are put in flash by default.
Don't need the old os_printf to define a macro to put string to flash manually.
This commit is contained in:
Wu Jian Gang
2018-05-24 10:17:00 +08:00
parent 9daf22b07b
commit 7665082ad0
2 changed files with 2 additions and 13 deletions

View File

@ -73,11 +73,7 @@ unsigned long os_random(void);
int os_get_random(unsigned char *buf, size_t len); int os_get_random(unsigned char *buf, size_t len);
#ifndef os_printf #ifndef os_printf
/* NOTE: don't use printf_opt in irq handler, for test */ #define os_printf printf
#define os_printf(fmt, ...) do { \
static const char flash_str[] ICACHE_RODATA_ATTR STORE_ATTR = fmt; \
printf(flash_str, ##__VA_ARGS__); \
} while(0)
#endif #endif
/* Note: check_memleak_debug_enable is a weak function inside SDK. /* Note: check_memleak_debug_enable is a weak function inside SDK.

View File

@ -63,14 +63,7 @@ extern void vPortFree(void *pv);
#define ssl_speed_up_enter() system_update_cpu_freq(SYS_CPU_160MHZ) #define ssl_speed_up_enter() system_update_cpu_freq(SYS_CPU_160MHZ)
#define ssl_speed_up_exit() system_update_cpu_freq(SYS_CPU_80MHZ) #define ssl_speed_up_exit() system_update_cpu_freq(SYS_CPU_80MHZ)
#ifndef os_printf #define SSL_DEBUG_LOG printf
#define os_printf(fmt, ...) do { \
static const char flash_str[] ICACHE_RODATA_ATTR STORE_ATTR = fmt; \
printf(flash_str, ##__VA_ARGS__); \
} while(0)
#endif
#define SSL_DEBUG_LOG os_printf
#define LOCAL_ATRR ICACHE_RODATA_ATTR STORE_ATTR #define LOCAL_ATRR ICACHE_RODATA_ATTR STORE_ATTR