Added some sanity checks to IDE.

This commit is contained in:
OBattler
2022-02-13 23:50:27 +01:00
parent ceabbd8176
commit 37c77cf0cf

View File

@@ -3018,8 +3018,11 @@ ide_reset(void *p)
{ {
ide_log("Resetting IDE...\n"); ide_log("Resetting IDE...\n");
ide_board_reset(0); if (ide_boards[0] != NULL)
ide_board_reset(1); ide_board_reset(0);
if (ide_boards[1] != NULL)
ide_board_reset(1);
} }
@@ -3029,8 +3032,15 @@ ide_close(void *priv)
{ {
ide_log("Closing IDE...\n"); ide_log("Closing IDE...\n");
ide_board_close(0); if (ide_boards[0] != NULL) {
ide_board_close(1); ide_board_close(0);
ide_boards[0] = NULL;
}
if (ide_boards[1] != NULL) {
ide_board_close(1);
ide_boards[1] = NULL;
}
} }