MEGA65 / mega65-tools

Tools and Utilities for the MEGA65 Retro Computers
GNU General Public License v3.0
30 stars 33 forks source link

MEGA65_FTP: add sdslot command #183

Open lydon42 opened 11 months ago

lydon42 commented 11 months ago

Add an sdslot command that allows switching of the currently active sdcard slot. Without argument it could also return the currently active slot, or this could be an extra command...

sdslot [0|1] - switches the sd card slot to internal (0) or external(1) slot.
               without argument displays the currently selected slot

Edit: The command will revert to the last sdslot if the newly selected slot could not be initialized (no sd card, wrong format). In that case it should return an error.

Example (with one card internal):

> sdslot
0
> sdslot 1
error: failed to initialize slot 1
0
> sdslot 0
0

or with two cards:

> sdslot 1
1
> sdslot
1
> sdslot 0
0
Taygair commented 11 months ago

Would be a great feature! When/if it comes to implementation a slot switch heading to a not present SD card should return something like "not present". That way the presence of SD cards can be evaluated before accessing them.