The nRF24L01+ wireless dongle firmware
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-nrf-dongle/Src/debug.c

36 lines
677 B

7 years ago
//
// Created by MightyPork on 2018/03/31.
//
#include "debug.h"
#include "main.h"
#include <stdarg.h>
#include "usart.h"
#define BUFLEN 128
static char buff[BUFLEN];
void dbg(const char *format, ...)
{
MX_USART_DmaWaitReady();
va_list args;
va_start (args, format);
uint32_t count = (uint32_t) vsprintf (buff, format, args);
if (count < BUFLEN - 2) {
buff[count++] = '\r';
buff[count++] = '\n';
buff[count] = 0;
}
va_end (args);
MX_USART_DmaSend((uint8_t *) buff, count);
// char c;
// char* ptr = buff;
// while ((c = *ptr++) != 0) {
// txchar(c);
// }
// txchar('\r');
// txchar('\n');
}