diff --git a/.gitignore b/.gitignore index 802f897..a544753 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,5 @@ Code/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.o Code/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.d Code/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.o Code/test.rom +EETool_pcb.jpg +EETool_sch.jpg diff --git a/Code/Descriptors.o b/Code/Descriptors.o index 5de7f06..b99895f 100644 Binary files a/Code/Descriptors.o and b/Code/Descriptors.o differ diff --git a/Code/EECommander b/Code/EECommander index 51e32eb..9b30d8d 100755 --- a/Code/EECommander +++ b/Code/EECommander @@ -1,6 +1,6 @@ #!/usr/bin/python -import sys, getopt, serial, binascii +import sys, getopt, serial, binascii, struct class Mode: @@ -20,6 +20,7 @@ class Command: PONG = 'PONG' BLOCKSIZE = 512 +CRCSIZE = 4 romfile = '' serialport = '' @@ -149,32 +150,41 @@ def dumpROM(): while 1: numBytes = connection.inWaiting() - if numBytes>=BLOCKSIZE: + if numBytes>=BLOCKSIZE + CRCSIZE: break - if (numBytes!=BLOCKSIZE): + if (numBytes!=BLOCKSIZE + CRCSIZE): print 'ERROR: Block',blockNum,'failed to download. Aborting.' sys.exit(2) response = connection.read(numBytes) + crc = struct.unpack('>=8; + } _delay_ms(10); PULSEC(LEDPIN); @@ -350,6 +359,28 @@ void WriteBlock() } +uint32_t CRC32(uint8_t *buf, size_t size) +{ + // This could be made faster with a table lookup, but it's plenty fast enough for our purposes + int i, j; + uint32_t byte, crc, mask; + + i = 0; + crc = 0xFFFFFFFF; + while (size--) + { + byte = buf[i]; + crc = crc ^ byte; + for (j = 7; j >= 0; j--) + { + mask = -(crc & 1); + crc = (crc >> 1) ^ (0xEDB88320 & mask); + } + i = i + 1; + } + return ~crc; +} + // USB Event Handlers void EVENT_USB_Device_Connect(void) { @@ -372,5 +403,3 @@ void EVENT_USB_Device_ControlRequest(void) { CDC_Device_ProcessControlRequest(&EETool_CDC_Interface); } - - diff --git a/Code/EETool.xcodeproj/project.xcworkspace/xcshareddata/EETool.xccheckout b/Code/EETool.xcodeproj/project.xcworkspace/xcshareddata/EETool.xccheckout new file mode 100644 index 0000000..a319381 --- /dev/null +++ b/Code/EETool.xcodeproj/project.xcworkspace/xcshareddata/EETool.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + 95794E8C-031F-41B1-9037-218BC0C75061 + IDESourceControlProjectName + project + IDESourceControlProjectOriginsDictionary + + 922DEEC8B722BFB3865485680EBE965F5270D110 + https://github.com/blondie7575/EETool.git + + IDESourceControlProjectPath + Code/EETool.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + 922DEEC8B722BFB3865485680EBE965F5270D110 + ../../.. + + IDESourceControlProjectURL + https://github.com/blondie7575/EETool.git + IDESourceControlProjectVersion + 111 + IDESourceControlProjectWCCIdentifier + 922DEEC8B722BFB3865485680EBE965F5270D110 + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + 922DEEC8B722BFB3865485680EBE965F5270D110 + IDESourceControlWCCName + EETool + + + +