feat(esp8266): Add ets_printf in SDK side

This commit is contained in:
Wu Jian Gang
2018-05-24 11:47:21 +08:00
parent 00765800e7
commit 26e825b0de
4 changed files with 64 additions and 2 deletions

View File

@ -2,13 +2,14 @@
#define _ROM_FUNCTIONS_H
#include <stdint.h>
#include <stdarg.h>
uint32_t Wait_SPI_Idle();
void uart_div_modify(uint32_t uart_no, uint32_t baud_div);
void ets_delay_us(uint32_t us);
int ets_printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
int ets_vprintf(void (*putc)(char), const char* fmt, va_list ap);
void system_soft_wdt_feed();

View File

@ -36,6 +36,18 @@ extern "C" {
uint32_t os_random(void);
int32_t os_get_random(unsigned char *buf, size_t len);
/**
* @brief Printf the strings to uart or other devices, similar with printf, simple than printf.
* Can not print float point data format, or longlong data format.
*
* @param const char *fmt : See printf.
*
* @param ... : See printf.
*
* @return int : the length printed to the output device.
*/
int ets_printf(const char *fmt, ...);
#ifndef os_printf
#define os_printf printf
#endif