fix merge error

This commit is contained in:
David Voswinkel 2009-07-08 18:25:41 +02:00
parent a518ff1e1e
commit 05db3108a2
3 changed files with 7 additions and 5 deletions

View File

@ -133,6 +133,7 @@ int main(int argc, char **argv)
uint8_t bank = 0; uint8_t bank = 0;
uint8_t bank_cnt = 0; uint8_t bank_cnt = 0;
uint32_t file_size = 0; uint32_t file_size = 0;
uint32_t file_offset = 0;
FILE *fp; FILE *fp;
usb_init(); usb_init();
@ -171,10 +172,11 @@ int main(int argc, char **argv)
fseek (fp, 0, SEEK_END); fseek (fp, 0, SEEK_END);
file_size = ftell (fp); file_size = ftell (fp);
file_offset = 512;
if (strstr(argv[2],".smc") || strstr(argv[2],".swc")){ if (strstr(argv[2],".smc") || strstr(argv[2],".swc")){
printf("Skip 512 Byte header\n"); printf("Skip 512 Byte header\n");
file_size -= 512; file_size -= 512;
fseek (fp, 512, SEEK_SET); fseek (fp, 512, SEEK_SET);
} else { } else {
@ -250,7 +252,7 @@ int main(int argc, char **argv)
0, 5000); 0, 5000);
fseek(fp, 0, SEEK_SET); fseek(fp, file_offset, SEEK_SET);
while ((cnt = fread(read_buffer, READ_BUFFER_SIZE, 1, fp)) > 0) { while ((cnt = fread(read_buffer, READ_BUFFER_SIZE, 1, fp)) > 0) {
printf ("bank=0x%02x crc=0x%04x\n", bank++, printf ("bank=0x%02x crc=0x%04x\n", bank++,
do_crc(read_buffer, READ_BUFFER_SIZE)); do_crc(read_buffer, READ_BUFFER_SIZE));

View File

@ -153,12 +153,12 @@ usbMsgLen_t usbFunctionSetup(uchar data[8])
rx_remaining = rq->wLength.word; rx_remaining = rq->wLength.word;
#if 0 #if 0
if (req_addr && (req_addr % 0x1000) == 0) { if (req_addr && (req_addr % 0x1000) == 0) {
debug(DEBUG_USB,"USB_UPLOAD_ADDR: bank=0x%02x addr=0x%08lx crc=%04x\n", debug(DEBUG_USB,"USB_BULK_UPLOAD_NEXT: bank=0x%02x addr=0x%08lx crc=%04x\n",
req_bank, req_addr,crc_check_bulk_memory(req_addr - 0x1000,req_addr)); req_bank, req_addr,crc_check_bulk_memory(req_addr - 0x1000,req_addr));
} }
#endif
sram_bulk_write_start(req_addr); sram_bulk_write_start(req_addr);
#endif
if (req_addr && req_addr % req_bank_size == 0) { if (req_addr && req_addr % req_bank_size == 0) {
debug(DEBUG_USB,"USB_BULK_UPLOAD_NEXT: req_bank=0x%02x addr= 0x%08lx time=%.4f\n", debug(DEBUG_USB,"USB_BULK_UPLOAD_NEXT: req_bank=0x%02x addr= 0x%08lx time=%.4f\n",
req_bank, req_addr,timer_stop()); req_bank, req_addr,timer_stop());

View File

@ -17,7 +17,7 @@
//#define XTAL 11059201L // nominal value //#define XTAL 11059201L // nominal value
#define XTAL 20000000UL #define XTAL 20000000UL
#define DEBOUNCE 256L // debounce clock (256Hz = 4msec) #define DEBOUNCE 500L // debounce clock (256Hz = 4msec)
#define uint8_t unsigned char #define uint8_t unsigned char
#define uint unsigned int #define uint unsigned int