Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions VortexEngine/src/Menus/MenuList/EditorConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,13 @@ void EditorConnection::handleState()
break;
}
UPDI::eraseMemory();


m_curStep = 0;
m_firmwareOffset = 0;
Leds::setAll(RGB_YELLOW3);
m_receiveBuffer.clear();
Leds::setAll(RGB_YELLOW3);
SerialComs::write(EDITOR_VERB_READY);
// TODO: this god awful delay idk why it's necessary but without
// it the serial seems to get stuck. It appears like an esp internals
// issue with serial but maybe this logic is just buggy -- it runs fine
// when simulated in test framework connected to editor though
Time::delayMilliseconds(300);
m_state = STATE_CHROMALINK_FLASH_FIRMWARE_RECEIVE;
break;
case STATE_CHROMALINK_FLASH_FIRMWARE_RECEIVE:
Expand All @@ -447,11 +444,6 @@ void EditorConnection::handleState()
}
// send ack
SerialComs::write(EDITOR_VERB_FLASH_FIRMWARE_ACK);
// TODO: this god awful delay idk why it's necessary but without
// it the serial seems to get stuck. It appears like an esp internals
// issue with serial but maybe this logic is just buggy -- it runs fine
// when simulated in test framework connected to editor though
Time::delayMilliseconds(5);
// only once the entire firmware is written
if (m_firmwareOffset >= m_firmwareSize) {
// then done
Expand Down
7 changes: 3 additions & 4 deletions VortexEngine/src/UPDI/updi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,12 @@ void UPDI::enterProgrammingMode()
stcs(Control_A, 0x6);
mode = cpu_mode<0xEF>();
if (mode != 0x82 && mode != 0x21 && mode != 0xA2 && mode != 0x08) {
sendDoubleBreak();
//sendDoubleBreak();
sendBreak();
uint8_t status = ldcs(Status_B);
ERROR_LOGF("Bad CPU Mode 0x%02x... error: 0x%02x", mode, status);
reset();
//reset();
continue;
//return false;
}
if (mode != 0x08) {
sendProgKey();
Expand All @@ -734,7 +734,6 @@ void UPDI::enterProgrammingMode()
ERROR_LOGF("Bad prog key status: 0x%02x", status);
reset();
continue;
//return false;
}
reset();
}
Expand Down