From ece53e044c70cbd626d0f145379200105fdb4ce7 Mon Sep 17 00:00:00 2001 From: Daniel Jobson Date: Wed, 4 Sep 2024 09:29:40 +0200 Subject: [PATCH] temp commit: Expose write functions to make development easier --- hw/application_fpga/Makefile | 2 +- hw/application_fpga/fw/tk1/proto.c | 3 +-- hw/application_fpga/fw/tk1/proto.h | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/application_fpga/Makefile b/hw/application_fpga/Makefile index 858724e..0b578d6 100644 --- a/hw/application_fpga/Makefile +++ b/hw/application_fpga/Makefile @@ -347,7 +347,7 @@ tb: # Synthesis. Place & Route. Bitstream generation. #------------------------------------------------------------------- -YOSYS_FLAG ?= +YOSYS_FLAG ?=-DINCLUDE_SPI_MASTER synth.json: $(FPGA_SRC) $(VERILOG_SRCS) $(PICORV32_SRCS) bram_fw.hex \ $(P)/data/uds.hex $(P)/data/udi.hex diff --git a/hw/application_fpga/fw/tk1/proto.c b/hw/application_fpga/fw/tk1/proto.c index a4f8f89..1ed69ae 100644 --- a/hw/application_fpga/fw/tk1/proto.c +++ b/hw/application_fpga/fw/tk1/proto.c @@ -23,7 +23,6 @@ static volatile uint32_t *tx = (volatile uint32_t *)TK1_MMIO_UART_TX_DATA; static uint8_t genhdr(uint8_t id, uint8_t endpoint, uint8_t status, enum cmdlen len); static int parseframe(uint8_t b, struct frame_header *hdr); -static void write(uint8_t *buf, size_t nbytes); static int read(uint8_t *buf, size_t bufsize, size_t nbytes); static size_t bytelen(enum cmdlen cmdlen); @@ -141,7 +140,7 @@ void writebyte(uint8_t b) } } -static void write(uint8_t *buf, size_t nbytes) +void write(uint8_t *buf, size_t nbytes) { for (int i = 0; i < nbytes; i++) { writebyte(buf[i]); diff --git a/hw/application_fpga/fw/tk1/proto.h b/hw/application_fpga/fw/tk1/proto.h index 28c97ec..e3f38cd 100644 --- a/hw/application_fpga/fw/tk1/proto.h +++ b/hw/application_fpga/fw/tk1/proto.h @@ -58,4 +58,5 @@ void writebyte(uint8_t b); uint8_t readbyte(void); void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf); int readcommand(struct frame_header *hdr, uint8_t *cmd, int state); +void write(uint8_t *buf, size_t nbytes); #endif