Wiki Home >> SIO-Command-$FF-Reset-FujiNet

SIO-Command-$FF-Reset-FujiNet


This is a command for Device $70 - The FujiNet Device itself (see SIO-Commands-for-Device-ID-$70).

Reset FujiNet ($FF)

Description

Causes the ESP to reboot, and thereby also re-mount the CONFIG boot disk.

>[!IMPORTANT]
>It's important to wait 5 seconds after issuing this command, to give the ESP sufficient time to reboot.

Parameters

DCBValue
DDEVIC$70
DUNIT$01
DCOMND$FF
DSTATS0x00
DBUFNULL
DTIMLO$0F
DBYT0
DAUX10
DAUX20

Examples

CC65

/**
 * Reset the ESP
 */
void reset(void)
{
  OS.dcb.ddevic=0x70;
  OS.dcb.dunit=1;
  OS.dcb.dcomnd=0xFF; // reset FujiNet device
  OS.dcb.dstats=0x40; // Peripheral->Computer
  OS.dcb.dbuf=0x00;
  OS.dcb.dtimlo=0x0F; // 15 second timeout
  OS.dcb.dbyt=0;      
  OS.dcb.daux=0;
  siov();

  OS.rtclok[0]=OS.rtclok[1]=OS.rtclok[2]=0;

  while (OS.rtclok[2]<255) { }  // Wait...
  asm("JMP $E477"); // do a cold start.

  return OS.dcb.dstats;
}

Wiki content is mirrored from the FujiNet Github Wiki