From: Gabriel Somlo Date: Fri, 27 Mar 2020 11:07:30 +0000 (-0400) Subject: software/libbase/spisdcard: fix width of address parameter X-Git-Tag: 24jan2021_ls180~510^2~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=540218b2d8cc5fcbb4c950aa3c659b21d471ac4f;p=litex.git 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 --- 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;