ams: std::optional -> util::optional

This commit is contained in:
Michael Scire 2021-07-08 02:37:26 -07:00
parent 9df13781c2
commit a7c14e03b9
59 changed files with 950 additions and 147 deletions

View file

@ -23,7 +23,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
namespace {
constinit std::optional<BatteryDevice> g_battery_device;
constinit util::optional<BatteryDevice> g_battery_device;
Max17050Driver &GetMax17050Driver() {
static Max17050Driver s_max17050_driver;
@ -91,7 +91,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
GetMax17050Driver().Finalize();
/* Destroy the charger device. */
g_battery_device = std::nullopt;
g_battery_device = util::nullopt;
/* Finalize gpio library. */
gpio::Finalize();

View file

@ -26,7 +26,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
AMS_DDSF_CASTABLE_TRAITS(ams::powctl::impl::board::nintendo::nx::BatteryDevice, ::ams::powctl::impl::IDevice);
private:
bool use_event_handler;
std::optional<BatteryInterruptEventHandler> event_handler;
util::optional<BatteryInterruptEventHandler> event_handler;
os::SystemEventType system_event;
public:
BatteryDevice(bool ev);

View file

@ -23,8 +23,8 @@ namespace ams::powctl::impl::board::nintendo::nx {
namespace {
constinit std::optional<ChargerDriver> g_charger_driver;
constinit std::optional<BatteryDriver> g_battery_driver;
constinit util::optional<ChargerDriver> g_charger_driver;
constinit util::optional<BatteryDriver> g_battery_driver;
void InitializeChargerDriver(bool use_event_handlers) {
/* Create the charger driver. */
@ -47,7 +47,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
powctl::impl::UnregisterDriver(std::addressof(*g_charger_driver));
/* Destroy the battery driver. */
g_charger_driver = std::nullopt;
g_charger_driver = util::nullopt;
}
void FinalizeBatteryDriver() {
@ -55,7 +55,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
powctl::impl::UnregisterDriver(std::addressof(*g_battery_driver));
/* Destroy the battery driver. */
g_battery_driver = std::nullopt;
g_battery_driver = util::nullopt;
}
}

View file

@ -23,7 +23,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
namespace {
constinit std::optional<ChargerDevice> g_charger_device;
constinit util::optional<ChargerDevice> g_charger_device;
Bq24193Driver &GetBq24193Driver() {
static Bq24193Driver s_bq24193_driver;
@ -80,7 +80,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
gpio::CloseSession(g_charger_device->GetPadSession());
/* Destroy the charger device. */
g_charger_device = std::nullopt;
g_charger_device = util::nullopt;
/* Finalize gpio library. */
gpio::Finalize();

View file

@ -29,7 +29,7 @@ namespace ams::powctl::impl::board::nintendo::nx {
bool watchdog_timer_enabled;
TimeSpan watchdog_timer_timeout;
bool use_event_handler;
std::optional<ChargerInterruptEventHandler> event_handler;
util::optional<ChargerInterruptEventHandler> event_handler;
os::SystemEventType system_event;
public:
ChargerDevice(bool ev);