1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-05-03 14:59:36 +00:00

Simplify polling for card detect

This commit is contained in:
Gyorgy Szombathelyi
2024-02-10 17:03:11 +01:00
parent 37dbd32466
commit 7fd97e143c

19
main.c
View File

@@ -222,8 +222,7 @@ int main(void)
usb_dev_open();
while (1) {
if (fat_uses_mmc())
MMC_CheckCard();
mmc_ok = fat_medium_present();
cdc_control_poll();
storage_control_poll();
@@ -235,20 +234,20 @@ int main(void)
// MIST (atari) core supports the same UI as Minimig
if((user_io_core_type() == CORE_TYPE_MIST) ||
(user_io_core_type() == CORE_TYPE_MIST2)) {
if(!fat_medium_present())
tos_eject_all();
if(!mmc_ok)
tos_eject_all();
HandleUI();
HandleUI();
}
// call original minimig handlers if minimig core is found
if((user_io_core_type() == CORE_TYPE_MINIMIG) ||
(user_io_core_type() == CORE_TYPE_MINIMIG2)) {
if(!fat_medium_present())
EjectAllFloppies();
(user_io_core_type() == CORE_TYPE_MINIMIG2)) {
if(!mmc_ok)
EjectAllFloppies();
HandleFpga();
HandleUI();
HandleFpga();
HandleUI();
}
// 8 bit cores can also have a ui if a valid config string can be read from it