boot: refactor to use sts::boot namespace

This commit is contained in:
Michael Scire committed 2019-06-22 00:10:21 -07:00
1 parent 4fbae9e5a4
commit 06416aeded
91 files changed
+3661 -3151

No files matched your search

+23 -19
View File
@@ -18,24 +18,28 @@
#include <switch.h>
#include <stratosphere.hpp>
#include "i2c/driver/i2c_api.hpp"
#include "boot_i2c_utils.hpp"
class RtcDriver {
private:
sts::i2c::driver::Session i2c_session;
public:
RtcDriver() {
sts::i2c::driver::Initialize();
sts::i2c::driver::OpenSession(&this->i2c_session, I2cDevice_Max77620Rtc);
}
namespace sts::boot {
~RtcDriver() {
sts::i2c::driver::CloseSession(this->i2c_session);
sts::i2c::driver::Finalize();
}
private:
Result ReadRtcRegister(u8 *out, u8 address);
public:
Result GetRtcIntr(u8 *out);
Result GetRtcIntrM(u8 *out);
};
class RtcDriver {
private:
i2c::driver::Session i2c_session;
public:
RtcDriver() {
i2c::driver::Initialize();
i2c::driver::OpenSession(&this->i2c_session, I2cDevice_Max77620Rtc);
}
~RtcDriver() {
i2c::driver::CloseSession(this->i2c_session);
i2c::driver::Finalize();
}
private:
Result ReadRtcRegister(u8 *out, u8 address);
public:
Result GetRtcIntr(u8 *out);
Result GetRtcIntrM(u8 *out);
};
}