Skip to content

Commit

Permalink
[coco] mount autorun on cold start.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschak909 committed Dec 12, 2023
1 parent 6615d98 commit c57bde5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/device/drivewire/fuji.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,21 +1571,27 @@ void drivewireFuji::set_drivewire_external_clock()
// Mounts the desired boot disk number
void drivewireFuji::insert_boot_device(uint8_t d)
{
Debug_printf("insert_boot_device()\n");

const char *config_atr = "/autorun.dsk";
FILE *fBoot;
size_t sz = 0;

_bootDisk.unmount();

switch (d)
{
case 0:
fBoot = fsFlash.file_open(config_atr);
_bootDisk.mount(fBoot, config_atr, 0);
fseek(fBoot,0,SEEK_END);
sz = ftell(fBoot);
fseek(fBoot,0,SEEK_SET);
_bootDisk.mount(fBoot, config_atr, sz);
break;
}

_bootDisk.is_config_device = true;
_bootDisk.device_active = false;
_bootDisk.device_active = true;
}

// Set UDP Stream HOST & PORT and start it
Expand Down Expand Up @@ -1618,6 +1624,7 @@ void drivewireFuji::enable_udpstream()
// Initializes base settings and adds our devices to the DRIVEWIRE bus
void drivewireFuji::setup(systemBus *drivewirebus)
{
Debug_printf("theFuji.setup()\n");
// set up Fuji device
_drivewire_bus = drivewirebus;

Expand Down Expand Up @@ -1655,8 +1662,8 @@ void drivewireFuji::process()

switch (c)
{
case FUJICMD_RESET:

default:
break;
}
}

Expand Down

0 comments on commit c57bde5

Please sign in to comment.