Skip to content

Commit 68290fa

Browse files
FozzTexxtschak909
authored andcommitted
Added SmartPort CONTROL and STATUS commands to clear/get monitor Disk II /DRIVEn enable status.
1 parent 3ee6db5 commit 68290fa

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

lib/bus/iwm/iwm.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ bool IRAM_ATTR iwmBus::serviceDiskII()
579579
break;
580580

581581
case iwm_enable_state_t::on:
582+
diskii_xface.d2_enable_seen |= diskii_xface.iwm_enable_states();
582583
#ifdef DEBUG
583584
new_track = IWM_ACTIVE_DISK2->get_track_pos();
584585
if (old_track != new_track)

lib/bus/iwm/iwm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ enum {
107107
#define IWM_CTRL_RUN_ROUTINE 0x05
108108
#define IWM_CTRL_DWNLD_ADDRESS 0x06
109109
#define IWM_CTRL_DOWNLOAD 0x07
110+
#define IWM_CTRL_CLEAR_ENSEEN 0x08
110111

111112
#define IWM_STATUS_STATUS 0x00
112113
#define IWM_STATUS_DCB 0x01
113114
#define IWM_STATUS_NEWLINE 0x02
114115
#define IWM_STATUS_DIB 0x03
115116
#define IWM_STATUS_UNI35 0x05
117+
#define IWM_STATUS_ENSEEN 0x08
116118

117119
// class def'ns
118120
class iwmFuji; // declare here so can reference it, but define in fuji.h

lib/bus/iwm/iwm_ll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ class iwm_diskii_ll : public iwm_ll
293293

294294
public:
295295
QueueHandle_t iwm_write_queue;
296+
uint8_t d2_enable_seen = 0;
296297

297298
// Phase lines and ACK handshaking
298299
uint8_t iwm_phase_vector() { return (uint8_t)(GPIO.in1.val & (uint32_t)0b1111); };

lib/device/iwm/fuji.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ iwmFuji::iwmFuji()
8080

8181
{ FUJICMD_RESET, [this]() { this->send_reply_packet(err_result); this->iwm_ctrl_reset_fujinet(); }}, // 0xFF
8282
{ IWM_CTRL_RESET, [this]() { this->send_reply_packet(err_result); this->iwm_ctrl_reset_fujinet(); }}, // 0x00
83+
{ IWM_CTRL_CLEAR_ENSEEN, [this]() { diskii_xface.d2_enable_seen = 0; err_result = SP_ERR_NOERROR; }},
8384

8485
{ FUJICMD_MOUNT_ALL, [&]() { err_result = (mount_all() ? SP_ERR_IOERROR : SP_ERR_NOERROR); }}, // 0xD7
8586
{ FUJICMD_MOUNT_IMAGE, [&]() { err_result = iwm_ctrl_disk_image_mount(); }}, // 0xF8
@@ -91,6 +92,7 @@ iwmFuji::iwmFuji()
9192

9293
{ IWM_STATUS_DIB, [this]() { this->send_status_dib_reply_packet(); status_completed = true; }}, // 0x03
9394
{ IWM_STATUS_STATUS, [this]() { this->send_status_reply_packet(); status_completed = true; }}, // 0x00
95+
{ IWM_STATUS_ENSEEN, [this]() { data_len = 1; data_buffer[0] = diskii_xface.d2_enable_seen; }},
9496

9597
{ FUJICMD_DEVICE_ENABLE_STATUS, [this]() { this->send_stat_get_enable(); }}, // 0xD1
9698
{ FUJICMD_GET_ADAPTERCONFIG_EXTENDED, [this]() { this->iwm_stat_get_adapter_config_extended(); }}, // 0xC4

0 commit comments

Comments
 (0)