Skip to content

Commit

Permalink
Add comments about ack is used as write protect.
Browse files Browse the repository at this point in the history
  • Loading branch information
FozzTexx authored and tschak909 committed Oct 3, 2024
1 parent 5f72cc9 commit db82a5d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/bus/iwm/iwm_ll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,9 +919,12 @@ void IRAM_ATTR iwm_diskii_ll::diskii_write_handler()

void iwm_diskii_ll::start(uint8_t drive, bool write_protect)
{
if (write_protect)
if (write_protect) {
// Signal that disk is write protected
smartport.iwm_ack_set();
}
else {
// Signal that disk can be written to
smartport.iwm_ack_clr();

d2w_buflen = cspi_alloc_continuous(IWM_NUMBYTES_FOR_BITS(TRACK_LEN * 8, d2w_buffer),
Expand Down Expand Up @@ -949,8 +952,9 @@ void iwm_diskii_ll::stop()
d2w_started = false;
heap_caps_free(d2w_desc);
heap_caps_free(d2w_buffer);
// Let SmartPort use write protect as ACK line again
smartport.iwm_ack_set();
}
smartport.iwm_ack_set();
gpio_isr_handler_remove(SP_WREQ);
fnLedManager.set(LED_BUS, false);
Debug_printf("\nstop diskII");
Expand Down

0 comments on commit db82a5d

Please sign in to comment.