Posted: 09:49pm 21 Oct 2024 |
Copy link to clipboard |
Print this post |
|
I don't know if this is helpful or not but I set/reset a flag "No_SD_Flag" using the up & down keys on a connected keyboard or IR remote. All routines accessing the SD card check the flag first. If no SD card, Exit Sub I press the down arrow, wait for the screen message & then remove the card. When finished, reinsert the card & press the UP arrow key. The sub routine does check that the card is actually there.
If you insert a different card, you will need another flags & commands.
'================================================================================================== SUB SD_Card_Rem 'Set flag if removed. If inserted, update data as necessary FONT 2 No_SD_Flag = 1 'set flag to stop R/W. Card can be removed TEXT 1700, 940, "REMOVE SD CARD ", "LT", 2, 1, RGB(RED), RGB(BLACK):PRINT @(0,0) END SUB '===================================================================================================== SUB SD_Card_Ins 'Set flag if removed. If inserted, update data as necessary FONT 2 print @(1700, 960) mm.info(sdcard) " " if MM.INFO(sdcard) <> "Not present" then No_SD_Flag = 0 Data_Flag = 0 'data_Flag & SD Card inserted TEXT 1700, 940, "SD Card OK ", "LT", 2, 1, RGB(green), RGB(BLACK):PRINT @(0,0) Check_SD endif END SUB '======================================================================================================= SUB Data_Save 'saves most screen data daily every 5 mins to SD card. FONT 2 if No_SD_Flag = 1 then exit sub . . .
Brian ChopperP |