I have this function that I would like to use to log over serial. Ideally, I would also like it to work when in an ISR context. However I’ve noticed some random crashes that I believe is occurring because of calling this function in an ISR. Does anyone know if these variable argument functions are ISR safe? If not, are there any other ways to support variable arguments in ISR context?
uint8_t Communication::log(const char* format, ...) {
char params[256];
va_list argp;
va_start(argp, format);
vsnprintf(params, 255, format, argp);
va_end(argp);
// ... sends param to an mbed mailbox (isr and thread safe)
}