System Calls

reset()

System.reset, reset

// PROTOTYPES
void reset();
void reset(SystemResetFlags flags);
void reset(uint32_t data, SystemResetFlags flags = SystemResetFlags());


// EXAMPLE
uint32_t lastReset = 0;

void setup() {
    lastReset = millis();
}

void loop() {
  // Reset after 5 minutes of operation
  // ==================================
  if (millis() - lastReset > 5*60000UL) {
    System.reset();
  }
}

Resets the device, just like hitting the reset button or powering down and back up.

  • If the data parameter is present, this is included in the reset reason as the user data parameter for RESET_REASON_USER.

Since 2.0.0:

  • SystemResetFlags can be specified in Device OS 2.0.0 and later. There is currently only one applicable flag:

    • RESET_NO_WAIT reset immediately and do not attempt to notify the cloud that a reset is about to occur.

In Device OS 2.0.0 and later, a call to System.reset() defaults to notifying the cloud of a pending reset and waiting for an acknowledgement. To prevent this, use the RESET_NO_WAIT flag.