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 tofalse.
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