Skip to main content

System API

Overview​

The System API provides functions for interacting with the Matrix OS system, such as rebooting the device, opening the settings menu, and rotating the interface.

The header file for this API is part of os/MatrixOS.h and the implementation is in os/system/System.cpp.


MatrixOS::SYS::Millis​

uint32_t Millis(void);

Returns the number of milliseconds since the device started. This can be used for time tracking or delays.

Returns:

  • uint32_t: Milliseconds elapsed since startup.

MatrixOS::SYS::DelayMs​

void DelayMs(uint32_t intervalMs);

Pauses execution for the specified duration.

Parameters:

  • intervalMs (uint32_t): Duration to delay in milliseconds.

MatrixOS::SYS::Reboot​

void Reboot(void);

Reboots the device.


MatrixOS::SYS::Bootloader​

void Bootloader(void);

Reboot the device into bootloader mode.


MatrixOS::SYS::OpenSetting​

void OpenSetting(void);

Opens the Matrix OS settings menu.


MatrixOS::SYS::Rotate​

void Rotate(EDirection rotation, bool absolute = false);

Rotates the interface or a specific component in the given direction.

Parameters:

  • rotation (EDirection): The direction of rotation.
  • absolute (bool, optional): Whether the rotation should be absolute (from the top position). Defaults to false.

MatrixOS::SYS::ExecuteAPP​

void ExecuteAPP(string author, string app_name);

Launches the specified application.

Parameters:

  • author (string): The author of the application.
  • app_name (string): The name of the application.

MatrixOS::SYS::ExitAPP​

void ExitAPP(void);

Exits the currently running application and returns to the application launcher.


MatrixOS::SYS::ErrorHandler​

void ErrorHandler(string error = "");

Handles errors and logs the specified error message.

Parameters:

  • error (string, optional): The error message to handle. Defaults to an empty string.

Comments