aboutsummaryrefslogtreecommitdiffstats
path: root/iceprog/iceprog.c
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-12-31 12:05:04 +0100
committerClifford Wolf <clifford@clifford.at>2015-12-31 12:05:04 +0100
commitb9e6d07e9ca9c4c6fb758e6886f43684948d70a7 (patch)
treef94bb5dcdc431a031ffde34d7307f10e86280547 /iceprog/iceprog.c
parent2d03b61380c3fec5f6d5b744c588eb76957db138 (diff)
downloadicestorm-b9e6d07e9ca9c4c6fb758e6886f43684948d70a7.tar.gz
icestorm-b9e6d07e9ca9c4c6fb758e6886f43684948d70a7.tar.bz2
icestorm-b9e6d07e9ca9c4c6fb758e6886f43684948d70a7.zip
Added config.mk, correct DESTDIR/PREFIX usage
Diffstat (limited to 'iceprog/iceprog.c')
-rw-r--r--iceprog/iceprog.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c
index d5419bd..26f893f 100644
--- a/iceprog/iceprog.c
+++ b/iceprog/iceprog.c
@@ -202,7 +202,7 @@ void flash_64kB_sector_erase(int addr)
{
fprintf(stderr, "erase 64kB sector at 0x%06X..\n", addr);
- uint8_t command[4] = { 0xd8, addr >> 16, addr >> 8, addr };
+ uint8_t command[4] = { 0xd8, (uint8_t)(addr >> 16), (uint8_t)(addr >> 8), (uint8_t)addr };
set_gpio(0, 0);
send_spi(command, 4);
set_gpio(1, 0);
@@ -213,7 +213,7 @@ void flash_prog(int addr, uint8_t *data, int n)
if (verbose)
fprintf(stderr, "prog 0x%06X +0x%03X..\n", addr, n);
- uint8_t command[4] = { 0x02, addr >> 16, addr >> 8, addr };
+ uint8_t command[4] = { 0x02, (uint8_t)(addr >> 16), (uint8_t)(addr >> 8), (uint8_t)addr };
set_gpio(0, 0);
send_spi(command, 4);
send_spi(data, n);
@@ -229,7 +229,7 @@ void flash_read(int addr, uint8_t *data, int n)
if (verbose)
fprintf(stderr, "read 0x%06X +0x%03X..\n", addr, n);
- uint8_t command[4] = { 0x03, addr >> 16, addr >> 8, addr };
+ uint8_t command[4] = { 0x03, (uint8_t)(addr >> 16), (uint8_t)(addr >> 8), (uint8_t)addr };
set_gpio(0, 0);
send_spi(command, 4);
memset(data, 0, n);
@@ -338,7 +338,7 @@ int main(int argc, char **argv)
bool test_mode = false;
const char *filename = NULL;
const char *devstr = NULL;
- int ifnum = INTERFACE_A;
+ enum ftdi_interface ifnum = INTERFACE_A;
int opt;
while ((opt = getopt(argc, argv, "d:I:rRcbnStv")) != -1)