Change the default down to 60, confirmed still working on the Mac Plus
@@ -93,6 +93,9 @@ int platform_network_init(char *mac)
log("WARNING: Wi-Fi MAC is not what was requested (%02x:%02x:%02x:%02x:%02x:%02x), is libpico not compiled with CYW43_USE_OTP_MAC=0?",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+ if (scsiDev.boardCfg.wifiSCSISleep < 1)
+ scsiDev.boardCfg.wifiSCSISleep = NETWORK_DEFAULT_SCSI_SLEEP;
+
network_in_use = true;
return 0;
@@ -142,8 +142,9 @@ typedef struct __attribute__((packed))
char wifiMACAddress[6];
char wifiSSID[32];
char wifiPassword[63];
+ uint8_t wifiSCSISleep;
- uint8_t reserved[18]; // Pad out to 128 bytes
+ uint8_t reserved[17]; // Pad out to 128 bytes
} S2S_BoardCfg;
typedef enum
@@ -179,7 +179,7 @@ int scsiNetworkCommand()
if (scsiDev.dataLen > 6)
{
- s2s_delay_us(80);
+ s2s_delay_us(scsiDev.boardCfg.wifiSCSISleep);
scsiWrite(scsiDev.data + 6, scsiDev.dataLen - 6);
while (!scsiIsWriteFinished(NULL))
@@ -32,6 +32,7 @@ extern "C" {
#define NETWORK_PACKET_QUEUE_SIZE 20 // must be <= 255
#define NETWORK_PACKET_MAX_SIZE 1520
+#define NETWORK_DEFAULT_SCSI_SLEEP 60
struct __attribute__((packed)) wifi_network_entry {
char ssid[64];
@@ -1062,6 +1062,8 @@ void s2s_configInit(S2S_BoardCfg* config)
memcpy(config->wifiPassword, tmp, sizeof(config->wifiPassword));
}
+ config->wifiSCSISleep = ini_getl("SCSI", "WiFiSCSISleep", 0, CONFIGFILE);
extern "C"