[ion] Made username volatile

This ensures the compiler doesn't assume that the username is fixed, allowing
us top change it before flashing, to let the user change his username.
This commit is contained in:
M4x1m3
2021-03-20 20:14:12 +01:00
parent 4242c77d64
commit a35fb141c4
3 changed files with 6 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ void ion_main(int argc, const char * const argv[]);
namespace Ion {
const char * serialNumber();
const char * username();
const volatile char * username();
const char * softwareVersion();
const char * omegaVersion();
const char * patchLevel();

View File

@@ -57,7 +57,7 @@ public:
assert(m_ohm_footer == OmegaMagic);
return m_omegaVersion;
}
const char * username() const {
const volatile char * username() const volatile {
assert(m_storageAddress != nullptr);
assert(m_storageSize != 0);
assert(m_header == Magic);
@@ -86,11 +86,11 @@ private:
uint32_t m_footer;
uint32_t m_ohm_header;
const char m_omegaVersion[16];
const char m_username[16];
const volatile char m_username[16];
uint32_t m_ohm_footer;
};
constexpr PlatformInfo HEADER_SECTION platform_infos;
const PlatformInfo HEADER_SECTION platform_infos;
const char * Ion::softwareVersion() {
return platform_infos.version();
@@ -100,7 +100,7 @@ const char * Ion::omegaVersion() {
return platform_infos.omegaVersion();
}
const char * Ion::username() {
const volatile char * Ion::username() {
return platform_infos.username();
}