software/libbase/spisdcard: fix width of address parameter
authorGabriel Somlo <gsomlo@gmail.com>
Fri, 27 Mar 2020 11:07:30 +0000 (07:07 -0400)
committerGabriel Somlo <gsomlo@gmail.com>
Fri, 27 Mar 2020 19:24:09 +0000 (15:24 -0400)
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 <gsomlo@gmail.com>
litex/soc/software/include/base/spisdcard.h
litex/soc/software/libbase/spisdcard.c

index 83689d5e85f32644015159de8dafab479e016717..85141578736270b13c6fab09236f60a6f60fd253 100644 (file)
@@ -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);
index 2027a0a2ca6e29fc7b262755dcbef30199138f35..0befe993b518d1a8dfc2495f039b0e742257dec3 100644 (file)
@@ -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;