System API
MatrixOS::SYS provides app-facing system helpers for time, delays, reboot/bootloader actions, settings, app switching, app exit, and error handling.
The public declarations are in OS/MatrixOS.h and the implementation is in OS/System/System.cpp.
Timeβ
MatrixOS::SYS::Millisβ
uint64_t Millis(void);
Returns milliseconds since Matrix OS started.
MatrixOS::SYS::Microsβ
uint64_t Micros(void);
Returns microseconds since Matrix OS started.
MatrixOS::SYS::DelayMsβ
void DelayMs(uint32_t ms);
Delays the current task for ms milliseconds. Prefer cooperative app loops for normal app timing; use delays sparingly.
System Actionsβ
MatrixOS::SYS::Rebootβ
void Reboot(void);
Reboots the device.
MatrixOS::SYS::Bootloaderβ
void Bootloader(void);
Reboots the device into bootloader mode.
MatrixOS::SYS::OpenSettingβ
void OpenSetting(void);
Opens Matrix OS settings.
App Switchingβ
MatrixOS::SYS::ExecuteAPPβ
void ExecuteAPP(uint32_t appId, const vector<string>& args = {});
void ExecuteAPP(string author, string appName, const vector<string>& args = {});
Launches another app by app ID, or by author and app name.
Parameters:
appId: target application ID.author: target application author.appName: target application name.args: optional arguments passed to the launched app.
MatrixOS::SYS::ExitAPPβ
void ExitAPP(void);
Exits the current app and returns to Matrix OS app flow.
Error Handlingβ
MatrixOS::SYS::ErrorHandlerβ
void ErrorHandler(string error = string());
Reports a system error. Use this for unrecoverable app or system states where Matrix OS should show or record the failure.
Device Rotationβ
Device rotation is exposed by the device layer, not MatrixOS::SYS:
Device::Rotate(Direction rotation, bool absolute = false);
Direction Device::GetRotation();
Use this only when your app intentionally changes the device orientation.
Comments