d0ca3b16f8
- Refactored GPS service and HAL: GPS is no longer part of the HAL configuration. You can now add configure new GPS devices from the GPS settings app. - T-Deck adds a boot hook to check if a GPS configuration exists and adds it when the config is empty. - Implemented the concept of ObjectFile to read/write arrays of a raw data type (e.g. struct) to disk. - Implemented more file utils (e.g. to create all directories of a path)
38 lines
861 B
C++
38 lines
861 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <functional>
|
|
|
|
namespace tt::kernel {
|
|
|
|
enum class SystemEvent {
|
|
BootInitHalBegin,
|
|
BootInitHalEnd,
|
|
BootInitI2cBegin,
|
|
BootInitI2cEnd,
|
|
BootInitSpiBegin,
|
|
BootInitSpiEnd,
|
|
BootInitUartBegin,
|
|
BootInitUartEnd,
|
|
BootInitLvglBegin,
|
|
BootInitLvglEnd,
|
|
BootSplash,
|
|
/** Gained IP address */
|
|
NetworkConnected,
|
|
NetworkDisconnected,
|
|
/** An important system time-related event, such as NTP update or time-zone change */
|
|
Time,
|
|
};
|
|
|
|
/** Value 0 mean "no subscription" */
|
|
typedef uint32_t SystemEventSubscription;
|
|
|
|
typedef std::function<void(SystemEvent)> OnSystemEvent;
|
|
|
|
void systemEventPublish(SystemEvent event);
|
|
|
|
SystemEventSubscription systemEventAddListener(SystemEvent event, OnSystemEvent handler);
|
|
|
|
void systemEventRemoveListener(SystemEventSubscription subscription);
|
|
|
|
} |