From 540218b2d8cc5fcbb4c950aa3c659b21d471ac4f Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Fri, 27 Mar 2020 07:07:30 -0400 Subject: [PATCH] software/libbase/spisdcard: fix width of address parameter Host address parameter types should match CPU word width, so use `unsigned long` to be correct on both 32 and 64 bit CPUs. Signed-off-by: Gabriel Somlo --- litex/soc/software/include/base/spisdcard.h | 2 +- litex/soc/software/libbase/spisdcard.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/soc/software/include/base/spisdcard.h b/litex/soc/software/include/base/spisdcard.h index 83689d5e..85141578 100644 --- a/litex/soc/software/include/base/spisdcard.h +++ b/litex/soc/software/include/base/spisdcard.h @@ -3,4 +3,4 @@ int spi_sdcard_read_sector(uint32_t device, uint32_t lba,uint_least8_t *buf); uint8_t spi_sdcard_goidle(void); uint8_t spi_sdcard_readMBR(void); -uint8_t spi_sdcard_readFile(char *, char *, uint32_t); +uint8_t spi_sdcard_readFile(char *, char *, unsigned long); diff --git a/litex/soc/software/libbase/spisdcard.c b/litex/soc/software/libbase/spisdcard.c index 2027a0a2..0befe993 100644 --- a/litex/soc/software/libbase/spisdcard.c +++ b/litex/soc/software/libbase/spisdcard.c @@ -523,7 +523,7 @@ uint8_t spi_sdcard_readMBR(void) // Return 0 success, 1 failure // // Details from https://codeandlife.com/2012/04/02/simple-fat-and-sd-tutorial-part-1/ -uint8_t spi_sdcard_readFile(char *filename, char *ext, uint32_t address) +uint8_t spi_sdcard_readFile(char *filename, char *ext, unsigned long address) { int i, n, sector; uint16_t fileClusterStart; -- 2.30.2