Firmware: fix compile errors with newer gccs

This commit is contained in:
Maximilian Rehkopf 2012-11-07 09:23:50 +01:00
parent e33fbdf77f
commit 83b18cc447
6 changed files with 11 additions and 17 deletions

View File

@ -75,7 +75,7 @@ ASRC = startup.S crc.S
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
# Use s -mcall-prologues when you really need size...
#OPT = 2
OPT = 2
OPT = s
# Debugging format.
DEBUG = dwarf-2

View File

@ -138,7 +138,7 @@ static int8_t parse_wordlist(char *wordlist) {
return -1;
}
if (tolower(c) != tolower(*cur)) {
if (tolower((int)c) != tolower((int)*cur)) {
// Check for end-of-word
if (cur != curchar && (*cur == ' ' || *cur == 0)) {
// Partial match found, return that

View File

@ -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 parent_tgt;
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_dirs_total = 0;
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);
if (res != FR_OK || fno.fname[0] == 0) {
if(pass) {
if(!numentries) was_empty=1;
/* if(!numentries) was_empty=1;*/
}
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);
}
dir_tgt += 4;
was_empty = 0;
/* was_empty = 0;*/
} else if(!mkdb) {
path[len]='/';
strncpy(path+len+1, (char*)fn, sizeof(fs_path)-len);

View File

@ -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) {
uint32_t count = 0;
uint32_t num = 0;
FPGA_DESELECT();
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++;
}
FPGA_DESELECT();
num = file_write();
file_write();
if(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) {
UINT bytes_read;
DWORD filesize;
uint16_t word_cnt;
uint8_t wordsize_cnt = 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);
filesize = file_handle.fsize;
if(file_res) {
printf("Could not read %s: error %d\n", filename, file_res);
return;

View File

@ -204,15 +204,12 @@ int msu1_loop() {
/* Data buffer refill */
if((fpga_status_now & 0x2000) != (fpga_status_prev & 0x2000)) {
DBG_MSU1 printf("data\n");
uint8_t pageno = 0;
if(fpga_status_now & 0x2000) {
msu_addr = 0x0;
msu_page1_start = msu_page2_start + msu_page_size;
pageno = 1;
} else {
msu_addr = 0x2000;
msu_page2_start = msu_page1_start + msu_page_size;
pageno = 2;
}
set_msu_addr(msu_addr);
sd_offload_tgt=2;

View File

@ -6,8 +6,8 @@
#include "xmodem.h"
void xmodem_rxfile(FIL* fil) {
uint8_t rxbuf[XMODEM_BLKSIZE], sum=0, sender_sum;
uint8_t blknum, blknum2;
uint8_t rxbuf[XMODEM_BLKSIZE], sum=0/*, sender_sum*/;
/* uint8_t blknum, blknum2;*/
uint8_t count;
uint32_t totalbytes = 0;
uint32_t totalwritten = 0;
@ -19,13 +19,13 @@ void xmodem_rxfile(FIL* fil) {
uart_putc(ASC_NAK);
} while (uart_getc() != ASC_SOH);
do {
blknum=uart_getc();
blknum2=uart_getc();
/*blknum=*/uart_getc();
/*blknum2=*/uart_getc();
for(count=0; count<XMODEM_BLKSIZE; count++) {
sum += rxbuf[count] = uart_getc();
totalbytes++;
}
sender_sum = uart_getc();
/*sender_sum =*/ uart_getc();
res=f_write(fil, rxbuf, XMODEM_BLKSIZE, &written);
totalwritten += written;
uart_putc(ASC_ACK);