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.
22 lines
423 B
22 lines
423 B
#include "debug.h"
|
|
#include "ringbuf_small.h"
|
|
|
|
ringbuf_t rb;
|
|
char dbuf[DEBUGCHARS];
|
|
|
|
FILE mystdout = FDEV_SETUP_STREAM(dbg_putchar, NULL,
|
|
_FDEV_SETUP_WRITE);
|
|
|
|
void dbg_init() {
|
|
ringbuf_init(&rb,dbuf,sizeof(dbuf));
|
|
|
|
}
|
|
|
|
uint8_t dbg_putchar(char c, FILE *stream) {
|
|
return ringbuf_put(&rb, (uint8_t) c);
|
|
}
|
|
|
|
int16_t dbg_getchar(int16_t dummy) {
|
|
return ringbuf_get(&rb);
|
|
}
|