File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -919,9 +919,12 @@ void IRAM_ATTR iwm_diskii_ll::diskii_write_handler()
919919
920920void iwm_diskii_ll::start (uint8_t drive, bool write_protect)
921921{
922- if (write_protect)
922+ if (write_protect) {
923+ // Signal that disk is write protected
923924 smartport.iwm_ack_set ();
925+ }
924926 else {
927+ // Signal that disk can be written to
925928 smartport.iwm_ack_clr ();
926929
927930 d2w_buflen = cspi_alloc_continuous (IWM_NUMBYTES_FOR_BITS (TRACK_LEN * 8 , d2w_buffer),
@@ -949,8 +952,9 @@ void iwm_diskii_ll::stop()
949952 d2w_started = false ;
950953 heap_caps_free (d2w_desc);
951954 heap_caps_free (d2w_buffer);
955+ // Let SmartPort use write protect as ACK line again
956+ smartport.iwm_ack_set ();
952957 }
953- smartport.iwm_ack_set ();
954958 gpio_isr_handler_remove (SP_WREQ);
955959 fnLedManager.set (LED_BUS, false );
956960 Debug_printf (" \n stop diskII" );
You can’t perform that action at this time.
0 commit comments