va_list returns something wrong
Posted: Mon Nov 15, 2021 8:25 am
Hi! I have very strange behaviour of my code. I don't undestand where is the problem.
Here I have vprintf-like function by wich I substitute output of in ESP_LOGe in
This is implementation
Where sw_uart_write is my own function that create one more software uart (bitbanging).
So if I write e.g.
I see this in my software uart output:
What can be wrong?
My sw_uart_write works ok. It's just simple bitbanging.
Here I have vprintf-like function by wich I substitute output of in ESP_LOGe in
- esp_log_set_vprintf(vprintf_like_t_sw_uart_write);
- int vprintf_like_t_sw_uart_write(const char *format, va_list args)
- {
- char buffer[100];
- sprintf(buffer, format, args);
- return sw_uart_write(buffer);
- }
So if I write e.g.
- arg = 0;
- ESP_LOGE("TAG", "esp_loge test %d", arg);
Whatever put instead of arg I always get 12.esp_loge test 12
What can be wrong?
My sw_uart_write works ok. It's just simple bitbanging.