diff --git a/src/Makefile b/src/Makefile index 76866b204..5e76a046a 100755 --- a/src/Makefile +++ b/src/Makefile @@ -154,6 +154,7 @@ FIRM_OBJ += $(addprefix $(BUILD)/$(OMV_DIR)/, \ stm32fxxx_hal_msp.o \ soft_i2c.o \ mutex.o \ + trace.o \ ) FIRM_OBJ += $(addprefix $(BUILD)/$(OMV_DIR)/img/,\ diff --git a/src/omv/Makefile b/src/omv/Makefile index 215cd5d67..21818c426 100644 --- a/src/omv/Makefile +++ b/src/omv/Makefile @@ -20,6 +20,7 @@ SRCS += $(addprefix , \ stm32fxxx_hal_msp.c \ soft_i2c.c \ mutex.c \ + trace.c \ ) SRCS += $(addprefix img/, \ diff --git a/src/omv/trace.c b/src/omv/trace.c new file mode 100644 index 000000000..5e5764f86 --- /dev/null +++ b/src/omv/trace.c @@ -0,0 +1,28 @@ +#include "trace.h" +#include +#include STM32_HAL_H + +#define TRACEBUF_SIZE (256) +typedef struct _tracebuf_t { + uint8_t idx; + uint8_t buf[TRACEBUF_SIZE]; +} tracebuf_t; + +static tracebuf_t tracebuf; + +void trace_init() +{ + tracebuf.idx = 0; + for (int i=0; i + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * Trace buffer. + * + */ +#ifndef __TRACE_H__ +#define __TRACE_H__ +#include +void trace_init(); +void trace_insert(uint32_t x); +#endif /* __TRACE_H__ */