rename xvprintf to vxprintf

This commit is contained in:
Данила Горнушко 2023-11-24 07:16:58 +03:00
parent 27c4f26f8f
commit b3729cff92
2 changed files with 4 additions and 4 deletions

View file

@ -9,12 +9,12 @@ RingbufHandle_t can_messages;
void init_tx_ringbuf() { void init_tx_ringbuf() {
can_messages = xRingbufferCreate(1028, RINGBUF_TYPE_NOSPLIT); can_messages = xRingbufferCreate(1028, RINGBUF_TYPE_NOSPLIT);
esp_log_set_vprintf(&xvprintf); esp_log_set_vprintf(&vxprintf);
} }
// This function will be called by the ESP log library every time ESP_LOG needs to be performed. // This function will be called by the ESP log library every time ESP_LOG needs to be performed.
// @important Do NOT use the ESP_LOG* macro's in this function ELSE recursive loop and stack overflow! So use printf() instead for debug messages. // @important Do NOT use the ESP_LOG* macro's in this function ELSE recursive loop and stack overflow! So use printf() instead for debug messages.
int xvprintf(const char *fmt, va_list args) { int vxprintf(const char *fmt, va_list args) {
char msg_to_send[200]; char msg_to_send[200];
size_t str_len; size_t str_len;
str_len = vsnprintf(msg_to_send, 199, fmt, args); str_len = vsnprintf(msg_to_send, 199, fmt, args);
@ -25,5 +25,5 @@ int xvprintf(const char *fmt, va_list args) {
int xprintf(const char *fmt, ...) { int xprintf(const char *fmt, ...) {
va_list(args); va_list(args);
va_start(args, fmt); va_start(args, fmt);
return xvprintf(fmt, args); return vxprintf(fmt, args);
} }

View file

@ -6,7 +6,7 @@
extern RingbufHandle_t can_messages; extern RingbufHandle_t can_messages;
void init_tx_ringbuf(); void init_tx_ringbuf();
int xvprintf(const char *fmt, va_list args); int vxprintf(const char *fmt, va_list args);
int xprintf(const char *fmt, ...); int xprintf(const char *fmt, ...);
// functions // functions