Skip to content

Commit 889e47a

Browse files
committed
Added an enable status latch register to query which Disk II enable lines FujiNet sees.
1 parent 901eaa1 commit 889e47a

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

include/version.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
as needed.
88
*/
99

10+
#ifndef _VERSION_H
11+
#define _VERSION_H
12+
1013
#define FN_VERSION_MAJOR 1
1114
#define FN_VERSION_MINOR 4
1215

@@ -15,3 +18,5 @@
1518
#define FN_VERSION_DATE "2024-08-07 20:49:13"
1619

1720
#define FN_VERSION_FULL "v1.4"
21+
22+
#endif /* _VERSION_H */

lib/bus/iwm/iwm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,14 @@ enum {
111111
#define IWM_CTRL_RUN_ROUTINE 0x05
112112
#define IWM_CTRL_DWNLD_ADDRESS 0x06
113113
#define IWM_CTRL_DOWNLOAD 0x07
114+
#define IWM_CTRL_CLEAR_ENSEEN 0x08
114115

115116
#define IWM_STATUS_STATUS 0x00
116117
#define IWM_STATUS_DCB 0x01
117118
#define IWM_STATUS_NEWLINE 0x02
118119
#define IWM_STATUS_DIB 0x03
119120
#define IWM_STATUS_UNI35 0x05
121+
#define IWM_STATUS_ENSEEN 0x08
120122

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

lib/bus/iwm/iwm_ll.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ uint8_t IRAM_ATTR iwm_diskii_ll::iwm_enable_states()
12111211
return 0;
12121212
}
12131213

1214+
d2_enable_seen |= states;
12141215
return states;
12151216
}
12161217

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/disk2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class iwmDisk2 : public iwmDisk
99
{
10-
1110
protected:
1211
MediaType *_disk = nullptr;
1312

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)