diff options
author | Roger Braunstein <[email protected]> | 2024-06-29 18:20:04 -0700 |
---|---|---|
committer | Roger Braunstein <[email protected]> | 2024-06-29 18:20:04 -0700 |
commit | 3ebfc53a18b9ee937fd5a5063ff380b3a7aa20e0 (patch) | |
tree | c0bcbbf30a84a2e6e2b80ef53c2383a02d2c6bb2 /Cart_Reader | |
parent | efe0dcf47d3a230eda2120066c98b1d53d303f4c (diff) | |
download | cartreader-3ebfc53a18b9ee937fd5a5063ff380b3a7aa20e0.tar.gz cartreader-3ebfc53a18b9ee937fd5a5063ff380b3a7aa20e0.zip |
Cleaning up debug stuff
Diffstat (limited to 'Cart_Reader')
-rw-r--r-- | Cart_Reader/PCE.ino | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Cart_Reader/PCE.ino b/Cart_Reader/PCE.ino index e514f18..e16a6e0 100644 --- a/Cart_Reader/PCE.ino +++ b/Cart_Reader/PCE.ino @@ -838,12 +838,11 @@ void flash_mode_PCE() { } // Implements data complement status checking +// We only look at D7, or the highest bit of expected void flash_wait_status_PCE(uint8_t expected) { set_cs_rd_low_PCE(); data_input_PCE(); - // We only look at D7, or the highest bit of expected - expected >>= 7; uint8_t status; do { PORTH &= ~(1 << 3); // RD low @@ -853,7 +852,7 @@ void flash_wait_status_PCE(uint8_t expected) { status = PINC; PORTH |= (1 << 3); // RD high // reversed, bit 0 is the MSB - } while ((status & 0x1) != expected); + } while ((status & 0x1) != (expected >> 7)); data_output_PCE(); // leave RD high on exit @@ -946,7 +945,6 @@ void flash_PCE() { uint32_t totalProgressBar = (uint32_t)fileSize; draw_progressbar(0, totalProgressBar); - unsigned long startMs = millis(); flash_mode_PCE(); const size_t BUFSIZE = 512; for (unsigned long currAddr = 0; currAddr < fileSize; currAddr += BUFSIZE) { @@ -964,11 +962,6 @@ void flash_PCE() { write_byte_PCE(0x5555, 0xA0); write_byte_PCE(currAddr + currByte, b); flash_wait_status_PCE(b); - - // tBP = 20us - // delayMicroseconds(20); - - // status polling = 38s } // update progress bar @@ -977,7 +970,6 @@ void flash_PCE() { } myFile.close(); pin_init_PCE(); - println_Msg((millis() - startMs) / 1000); print_STR(done_STR, true); } display_Update(); |