fix merge error
This commit is contained in:
parent
a518ff1e1e
commit
05db3108a2
@ -133,6 +133,7 @@ int main(int argc, char **argv)
|
||||
uint8_t bank = 0;
|
||||
uint8_t bank_cnt = 0;
|
||||
uint32_t file_size = 0;
|
||||
uint32_t file_offset = 0;
|
||||
|
||||
FILE *fp;
|
||||
usb_init();
|
||||
@ -171,10 +172,11 @@ int main(int argc, char **argv)
|
||||
|
||||
fseek (fp, 0, SEEK_END);
|
||||
file_size = ftell (fp);
|
||||
|
||||
file_offset = 512;
|
||||
if (strstr(argv[2],".smc") || strstr(argv[2],".swc")){
|
||||
printf("Skip 512 Byte header\n");
|
||||
file_size -= 512;
|
||||
|
||||
fseek (fp, 512, SEEK_SET);
|
||||
|
||||
} else {
|
||||
@ -250,7 +252,7 @@ int main(int argc, char **argv)
|
||||
0, 5000);
|
||||
|
||||
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fseek(fp, file_offset, SEEK_SET);
|
||||
while ((cnt = fread(read_buffer, READ_BUFFER_SIZE, 1, fp)) > 0) {
|
||||
printf ("bank=0x%02x crc=0x%04x\n", bank++,
|
||||
do_crc(read_buffer, READ_BUFFER_SIZE));
|
||||
|
||||
@ -153,12 +153,12 @@ usbMsgLen_t usbFunctionSetup(uchar data[8])
|
||||
rx_remaining = rq->wLength.word;
|
||||
#if 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));
|
||||
|
||||
}
|
||||
#endif
|
||||
sram_bulk_write_start(req_addr);
|
||||
#endif
|
||||
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",
|
||||
req_bank, req_addr,timer_stop());
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
//#define XTAL 11059201L // nominal value
|
||||
#define XTAL 20000000UL
|
||||
|
||||
#define DEBOUNCE 256L // debounce clock (256Hz = 4msec)
|
||||
#define DEBOUNCE 500L // debounce clock (256Hz = 4msec)
|
||||
|
||||
#define uint8_t unsigned char
|
||||
#define uint unsigned int
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user