From e84881072f88eca0c366614dc69a21791ebdba7d Mon Sep 17 00:00:00 2001 From: Andrew Dennison Date: Tue, 30 May 2023 15:19:20 +1000 Subject: [PATCH] software/liblitespi: fix building with debug --- litex/soc/software/liblitespi/spiflash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/litex/soc/software/liblitespi/spiflash.c b/litex/soc/software/liblitespi/spiflash.c index 503b15301..410c43948 100644 --- a/litex/soc/software/liblitespi/spiflash.c +++ b/litex/soc/software/liblitespi/spiflash.c @@ -147,7 +147,7 @@ static uint32_t spiflash_read_status_register(void) w_buf[1] = 0x00; transfer_cmd(w_buf, buf, 4); -#if SPIFLASH_DEBUG +#ifdef SPIFLASH_DEBUG printf("[SR: %02x %02x %02x %02x]", buf[0], buf[1], buf[2], buf[3]); #endif @@ -220,7 +220,7 @@ int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len) uint32_t offset = 0; uint32_t j = 0; -#if SPIFLASH_DEBUG +#ifdef SPIFLASH_DEBUG printf("Write SPI Flash @0x%08lx", ((uint32_t)addr)); #endif @@ -229,7 +229,7 @@ int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len) page_program(addr+offset, stream+offset, w_len); while(spiflash_read_status_register() & 1) { -#if SPIFLASH_DEBUG +#ifdef SPIFLASH_DEBUG printf("."); #endif } @@ -245,7 +245,7 @@ int spiflash_write_stream(uint32_t addr, uint8_t *stream, uint32_t len) w_len = min(len-offset, SPI_FLASH_BLOCK_SIZE); res = offset; } -#if SPIFLASH_DEBUG +#ifdef SPIFLASH_DEBUG printf("\n"); #endif return res;