Skip to content

Commit c3719ec

Browse files
committed
[FN-PC/Atari] poll NetSIO from sio_copy_file()
1 parent 8fad24b commit c3719ec

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/bus/sio/siocom/netsio.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ void NetSioPort::end()
168168
bool NetSioPort::poll(int ms)
169169
{
170170
if (_initialized)
171-
return wait_sock_readable(ms);
171+
{
172+
if (handle_netsio() > 0)
173+
return true;
174+
return (wait_sock_readable(ms));
175+
}
172176
fnSystem.delay(ms);
173177
return false;
174178
}

lib/device/sio/fuji.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@ void sioFuji::sio_copy_file()
554554
char *dataBuf;
555555
unsigned char sourceSlot;
556556
unsigned char destSlot;
557+
#ifndef ESP_PLATFORM
558+
uint64_t poll_ts = fnSystem.millis();
559+
#endif
557560

558561
dataBuf = (char *)malloc(532);
559562

@@ -648,6 +651,13 @@ void sioFuji::sio_copy_file()
648651
bool err = false;
649652
do
650653
{
654+
#ifndef ESP_PLATFORM
655+
if (fnSioCom.get_sio_mode() == SioCom::sio_mode::NETSIO && fnSystem.millis() - poll_ts > 1000)
656+
{
657+
fnSioCom.poll(1);
658+
poll_ts = fnSystem.millis();
659+
}
660+
#endif
651661
readCount = fnio::fread(dataBuf, 1, 532, sourceFile);
652662
readTotal += readCount;
653663
// Check if we got enough bytes on the read

0 commit comments

Comments
 (0)