shell: internal api update: fprintf

Add z_ prefix to internal fprintf functions and macros.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
Jakub Rzeszutko 2020-12-06 11:22:27 +01:00 committed by Carles Cufí
commit 460995c810
10 changed files with 70 additions and 82 deletions

View file

@ -711,8 +711,8 @@ struct shell {
k_thread_stack_t *stack;
};
extern void shell_print_stream(const void *user_ctx, const char *data,
size_t data_len);
extern void z_shell_print_stream(const void *user_ctx, const char *data,
size_t data_len);
/**
* @brief Macro for defining a shell instance.
*
@ -730,14 +730,14 @@ extern void shell_print_stream(const void *user_ctx, const char *data,
_log_queue_size, _log_timeout, _shell_flag) \
static const struct shell _name; \
static struct shell_ctx UTIL_CAT(_name, _ctx); \
static uint8_t _name##_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; \
static uint8_t _name##_out_buffer[CONFIG_SHELL_PRINTF_BUFF_SIZE]; \
SHELL_LOG_BACKEND_DEFINE(_name, _name##_out_buffer, \
CONFIG_SHELL_PRINTF_BUFF_SIZE, \
_log_queue_size, _log_timeout); \
SHELL_HISTORY_DEFINE(_name##_history, CONFIG_SHELL_HISTORY_BUFFER); \
SHELL_FPRINTF_DEFINE(_name##_fprintf, &_name, _name##_out_buffer, \
Z_SHELL_FPRINTF_DEFINE(_name##_fprintf, &_name, _name##_out_buffer, \
CONFIG_SHELL_PRINTF_BUFF_SIZE, \
true, shell_print_stream); \
true, z_shell_print_stream); \
LOG_INSTANCE_REGISTER(shell, _name, CONFIG_SHELL_LOG_LEVEL); \
SHELL_STATS_DEFINE(_name); \
static K_KERNEL_STACK_DEFINE(_name##_stack, CONFIG_SHELL_STACK_SIZE); \

View file

@ -16,8 +16,8 @@ extern "C" {
#endif
typedef void (*shell_fprintf_fwrite)(const void *user_ctx,
const char *data,
size_t length);
const char *data,
size_t length);
struct shell_fprintf_control_block {
size_t buffer_cnt;
@ -44,7 +44,7 @@ struct shell_fprintf {
* @param _autoflush Indicator if buffer shall be automatically flush.
* @param _fwrite Pointer to function sending data stream.
*/
#define SHELL_FPRINTF_DEFINE(_name, _user_ctx, _buf, _size, \
#define Z_SHELL_FPRINTF_DEFINE(_name, _user_ctx, _buf, _size, \
_autoflush, _fwrite) \
static struct shell_fprintf_control_block \
_name##_shell_fprintf_ctx = { \
@ -66,15 +66,15 @@ struct shell_fprintf {
* @param fmt Format string.
* @param args List of parameters to print.
*/
void shell_fprintf_fmt(const struct shell_fprintf *sh_fprintf,
char const *fmt, va_list args);
void z_shell_fprintf_fmt(const struct shell_fprintf *sh_fprintf,
char const *fmt, va_list args);
/**
* @brief function flushing data stored in io_buffer.
*
* @param sh_fprintf fprintf instance
*/
void shell_fprintf_buffer_flush(const struct shell_fprintf *sh_fprintf);
void z_shell_fprintf_buffer_flush(const struct shell_fprintf *sh_fprintf);
#ifdef __cplusplus
}