Firmware: fix compile errors with newer gccs
This commit is contained in:
@@ -75,7 +75,7 @@ ASRC = startup.S crc.S
|
|||||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
||||||
# Use s -mcall-prologues when you really need size...
|
# Use s -mcall-prologues when you really need size...
|
||||||
#OPT = 2
|
#OPT = 2
|
||||||
OPT = 2
|
OPT = s
|
||||||
|
|
||||||
# Debugging format.
|
# Debugging format.
|
||||||
DEBUG = dwarf-2
|
DEBUG = dwarf-2
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ static int8_t parse_wordlist(char *wordlist) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tolower(c) != tolower(*cur)) {
|
if (tolower((int)c) != tolower((int)*cur)) {
|
||||||
// Check for end-of-word
|
// Check for end-of-word
|
||||||
if (cur != curchar && (*cur == ' ' || *cur == 0)) {
|
if (cur != curchar && (*cur == ' ' || *cur == 0)) {
|
||||||
// Partial match found, return that
|
// Partial match found, return that
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ uint32_t scan_dir(char* path, FILINFO* fno_param, char mkdb, uint32_t this_dir_t
|
|||||||
static uint32_t next_subdir_tgt;
|
static uint32_t next_subdir_tgt;
|
||||||
static uint32_t parent_tgt;
|
static uint32_t parent_tgt;
|
||||||
static uint32_t dir_end = 0;
|
static uint32_t dir_end = 0;
|
||||||
static uint8_t was_empty = 0;
|
/* static uint8_t was_empty = 0;*/
|
||||||
static uint16_t num_files_total = 0;
|
static uint16_t num_files_total = 0;
|
||||||
static uint16_t num_dirs_total = 0;
|
static uint16_t num_dirs_total = 0;
|
||||||
uint32_t dir_tgt;
|
uint32_t dir_tgt;
|
||||||
@@ -147,7 +147,7 @@ uint32_t scan_dir(char* path, FILINFO* fno_param, char mkdb, uint32_t this_dir_t
|
|||||||
res = f_readdir(&dir, &fno);
|
res = f_readdir(&dir, &fno);
|
||||||
if (res != FR_OK || fno.fname[0] == 0) {
|
if (res != FR_OK || fno.fname[0] == 0) {
|
||||||
if(pass) {
|
if(pass) {
|
||||||
if(!numentries) was_empty=1;
|
/* if(!numentries) was_empty=1;*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -194,7 +194,7 @@ uint32_t scan_dir(char* path, FILINFO* fno_param, char mkdb, uint32_t this_dir_t
|
|||||||
sram_writeblock("/\0", old_db_tgt + sizeof(next_subdir_tgt) + sizeof(len) + pathlen, 2);
|
sram_writeblock("/\0", old_db_tgt + sizeof(next_subdir_tgt) + sizeof(len) + pathlen, 2);
|
||||||
}
|
}
|
||||||
dir_tgt += 4;
|
dir_tgt += 4;
|
||||||
was_empty = 0;
|
/* was_empty = 0;*/
|
||||||
} else if(!mkdb) {
|
} else if(!mkdb) {
|
||||||
path[len]='/';
|
path[len]='/';
|
||||||
strncpy(path+len+1, (char*)fn, sizeof(fs_path)-len);
|
strncpy(path+len+1, (char*)fn, sizeof(fs_path)-len);
|
||||||
|
|||||||
@@ -473,7 +473,6 @@ uint32_t load_bootrle(uint32_t base_addr) {
|
|||||||
|
|
||||||
void save_sram(uint8_t* filename, uint32_t sram_size, uint32_t base_addr) {
|
void save_sram(uint8_t* filename, uint32_t sram_size, uint32_t base_addr) {
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
uint32_t num = 0;
|
|
||||||
|
|
||||||
FPGA_DESELECT();
|
FPGA_DESELECT();
|
||||||
file_open(filename, FA_CREATE_ALWAYS | FA_WRITE);
|
file_open(filename, FA_CREATE_ALWAYS | FA_WRITE);
|
||||||
@@ -490,7 +489,7 @@ void save_sram(uint8_t* filename, uint32_t sram_size, uint32_t base_addr) {
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
FPGA_DESELECT();
|
FPGA_DESELECT();
|
||||||
num = file_write();
|
file_write();
|
||||||
if(file_res) {
|
if(file_res) {
|
||||||
uart_putc(0x30+file_res);
|
uart_putc(0x30+file_res);
|
||||||
}
|
}
|
||||||
@@ -594,7 +593,6 @@ uint64_t sram_gettime(uint32_t base_addr) {
|
|||||||
|
|
||||||
void load_dspx(const uint8_t *filename, uint8_t coretype) {
|
void load_dspx(const uint8_t *filename, uint8_t coretype) {
|
||||||
UINT bytes_read;
|
UINT bytes_read;
|
||||||
DWORD filesize;
|
|
||||||
uint16_t word_cnt;
|
uint16_t word_cnt;
|
||||||
uint8_t wordsize_cnt = 0;
|
uint8_t wordsize_cnt = 0;
|
||||||
uint16_t sector_remaining = 0;
|
uint16_t sector_remaining = 0;
|
||||||
@@ -618,7 +616,6 @@ void load_dspx(const uint8_t *filename, uint8_t coretype) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_open((uint8_t*)filename, FA_READ);
|
file_open((uint8_t*)filename, FA_READ);
|
||||||
filesize = file_handle.fsize;
|
|
||||||
if(file_res) {
|
if(file_res) {
|
||||||
printf("Could not read %s: error %d\n", filename, file_res);
|
printf("Could not read %s: error %d\n", filename, file_res);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -204,15 +204,12 @@ int msu1_loop() {
|
|||||||
/* Data buffer refill */
|
/* Data buffer refill */
|
||||||
if((fpga_status_now & 0x2000) != (fpga_status_prev & 0x2000)) {
|
if((fpga_status_now & 0x2000) != (fpga_status_prev & 0x2000)) {
|
||||||
DBG_MSU1 printf("data\n");
|
DBG_MSU1 printf("data\n");
|
||||||
uint8_t pageno = 0;
|
|
||||||
if(fpga_status_now & 0x2000) {
|
if(fpga_status_now & 0x2000) {
|
||||||
msu_addr = 0x0;
|
msu_addr = 0x0;
|
||||||
msu_page1_start = msu_page2_start + msu_page_size;
|
msu_page1_start = msu_page2_start + msu_page_size;
|
||||||
pageno = 1;
|
|
||||||
} else {
|
} else {
|
||||||
msu_addr = 0x2000;
|
msu_addr = 0x2000;
|
||||||
msu_page2_start = msu_page1_start + msu_page_size;
|
msu_page2_start = msu_page1_start + msu_page_size;
|
||||||
pageno = 2;
|
|
||||||
}
|
}
|
||||||
set_msu_addr(msu_addr);
|
set_msu_addr(msu_addr);
|
||||||
sd_offload_tgt=2;
|
sd_offload_tgt=2;
|
||||||
|
|||||||
10
src/xmodem.c
10
src/xmodem.c
@@ -6,8 +6,8 @@
|
|||||||
#include "xmodem.h"
|
#include "xmodem.h"
|
||||||
|
|
||||||
void xmodem_rxfile(FIL* fil) {
|
void xmodem_rxfile(FIL* fil) {
|
||||||
uint8_t rxbuf[XMODEM_BLKSIZE], sum=0, sender_sum;
|
uint8_t rxbuf[XMODEM_BLKSIZE], sum=0/*, sender_sum*/;
|
||||||
uint8_t blknum, blknum2;
|
/* uint8_t blknum, blknum2;*/
|
||||||
uint8_t count;
|
uint8_t count;
|
||||||
uint32_t totalbytes = 0;
|
uint32_t totalbytes = 0;
|
||||||
uint32_t totalwritten = 0;
|
uint32_t totalwritten = 0;
|
||||||
@@ -19,13 +19,13 @@ void xmodem_rxfile(FIL* fil) {
|
|||||||
uart_putc(ASC_NAK);
|
uart_putc(ASC_NAK);
|
||||||
} while (uart_getc() != ASC_SOH);
|
} while (uart_getc() != ASC_SOH);
|
||||||
do {
|
do {
|
||||||
blknum=uart_getc();
|
/*blknum=*/uart_getc();
|
||||||
blknum2=uart_getc();
|
/*blknum2=*/uart_getc();
|
||||||
for(count=0; count<XMODEM_BLKSIZE; count++) {
|
for(count=0; count<XMODEM_BLKSIZE; count++) {
|
||||||
sum += rxbuf[count] = uart_getc();
|
sum += rxbuf[count] = uart_getc();
|
||||||
totalbytes++;
|
totalbytes++;
|
||||||
}
|
}
|
||||||
sender_sum = uart_getc();
|
/*sender_sum =*/ uart_getc();
|
||||||
res=f_write(fil, rxbuf, XMODEM_BLKSIZE, &written);
|
res=f_write(fil, rxbuf, XMODEM_BLKSIZE, &written);
|
||||||
totalwritten += written;
|
totalwritten += written;
|
||||||
uart_putc(ASC_ACK);
|
uart_putc(ASC_ACK);
|
||||||
|
|||||||
Reference in New Issue
Block a user