mirror of
https://github.com/dougg3/mac-rom-simm-programmer.git
synced 2024-11-25 10:30:49 +00:00
Fixed a bug with how many bytes I was allowing to be written. It mostly works but it writes the chips in reverse...oops
This commit is contained in:
parent
ca84a1d562
commit
b052bb62f8
@ -52,7 +52,7 @@ typedef enum ProgrammerCommandState
|
||||
ReadingByteWaitingForAddress,
|
||||
ReadingChips,
|
||||
ReadingChipsUnableSendError,
|
||||
WritingChips,
|
||||
WritingChips
|
||||
} ProgrammerCommandState;
|
||||
|
||||
typedef enum ProgrammerCommand
|
||||
@ -63,20 +63,20 @@ typedef enum ProgrammerCommand
|
||||
ReadByte,
|
||||
ReadChips,
|
||||
EraseChips,
|
||||
WriteChips,
|
||||
WriteChips
|
||||
} ProgrammerCommand;
|
||||
|
||||
typedef enum ProgrammerReply
|
||||
{
|
||||
CommandReplyOK,
|
||||
CommandReplyError,
|
||||
CommandReplyInvalid,
|
||||
CommandReplyInvalid
|
||||
} ProgrammerReply;
|
||||
|
||||
typedef enum ComputerReadReply
|
||||
{
|
||||
ComputerReadOK,
|
||||
ComputerReadCancel,
|
||||
ComputerReadCancel
|
||||
} ComputerReadReply;
|
||||
|
||||
typedef enum ProgrammerReadReply
|
||||
@ -85,22 +85,22 @@ typedef enum ProgrammerReadReply
|
||||
ProgrammerReadError,
|
||||
ProgrammerReadMoreData,
|
||||
ProgrammerReadFinished,
|
||||
ProgrammerReadConfirmCancel,
|
||||
ProgrammerReadConfirmCancel
|
||||
} ProgrammerReadReply;
|
||||
|
||||
typedef enum ComputerWriteReply
|
||||
{
|
||||
ComputerWriteMore,
|
||||
ComputerWriteFinish,
|
||||
ComputerWriteCancel,
|
||||
ComputerWriteCancel
|
||||
} ComputerWriteReply;
|
||||
|
||||
typedef enum ProgrammerWriteReply
|
||||
{
|
||||
ProgrammerWriteOK,
|
||||
ProgrammerWriteError,
|
||||
ProgrammerWriteConfirmCancel,
|
||||
};
|
||||
ProgrammerWriteConfirmCancel
|
||||
} ProgrammerWriteReply;
|
||||
|
||||
static ProgrammerCommandState curCommandState = WaitingForCommand;
|
||||
static uint8_t byteAddressReceiveCount = 0;
|
||||
@ -274,7 +274,7 @@ void USBSerial_HandleReadingChipsByte(uint8_t byte)
|
||||
switch (byte)
|
||||
{
|
||||
case ComputerReadOK:
|
||||
if (curReadIndex >= (CHIP_SIZE / READ_CHUNK_SIZE_BYTES))
|
||||
if (curReadIndex >= (CHIP_SIZE / (READ_CHUNK_SIZE_BYTES/4)))
|
||||
{
|
||||
SendByte(ProgrammerReadFinished);
|
||||
curCommandState = WaitingForCommand;
|
||||
@ -330,7 +330,7 @@ void USBSerial_HandleWritingChipsByte(uint8_t byte)
|
||||
{
|
||||
case ComputerWriteMore:
|
||||
writePosInChunk = 0;
|
||||
if (curWriteIndex < CHIP_SIZE / WRITE_CHUNK_SIZE_BYTES)
|
||||
if (curWriteIndex < CHIP_SIZE / (WRITE_CHUNK_SIZE_BYTES/4))
|
||||
{
|
||||
SendByte(ProgrammerWriteOK);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user