temp commit: Expose write functions to make development easier

This commit is contained in:
Daniel Jobson 2024-09-04 09:29:40 +02:00
parent 534ac06e86
commit 0bec032db3
No known key found for this signature in database
GPG Key ID: 3707A9DBF4BB8F1A
3 changed files with 3 additions and 3 deletions

View File

@ -270,7 +270,7 @@ tb:
# builds. # builds.
#------------------------------------------------------------------- #-------------------------------------------------------------------
YOSYS_FLAG ?= YOSYS_FLAG ?=-DINCLUDE_SPI_MASTER
synth.json: $(FPGA_SRC) $(VERILOG_SRCS) bram_fw.hex $(P)/data/uds.hex $(P)/data/udi.hex synth.json: $(FPGA_SRC) $(VERILOG_SRCS) bram_fw.hex $(P)/data/uds.hex $(P)/data/udi.hex
$(YOSYS_PATH)yosys -v3 -l synth.log $(YOSYS_FLAG) -DBRAM_FW_SIZE=$(BRAM_FW_SIZE) \ $(YOSYS_PATH)yosys -v3 -l synth.log $(YOSYS_FLAG) -DBRAM_FW_SIZE=$(BRAM_FW_SIZE) \

View File

@ -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, static uint8_t genhdr(uint8_t id, uint8_t endpoint, uint8_t status,
enum cmdlen len); enum cmdlen len);
static int parseframe(uint8_t b, struct frame_header *hdr); 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 int read(uint8_t *buf, size_t bufsize, size_t nbytes);
static int bytelen(enum cmdlen cmdlen); static int 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++) { for (int i = 0; i < nbytes; i++) {
writebyte(buf[i]); writebyte(buf[i]);

View File

@ -58,4 +58,5 @@ void writebyte(uint8_t b);
uint8_t readbyte(void); uint8_t readbyte(void);
void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf); void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf);
int readcommand(struct frame_header *hdr, uint8_t *cmd, int state); int readcommand(struct frame_header *hdr, uint8_t *cmd, int state);
void write(uint8_t *buf, size_t nbytes);
#endif #endif