Fixed all the includes that were broken due to the renames

This commit is contained in:
Avamander
2020-10-02 22:16:48 +03:00
parent 4daab26926
commit 6c86d1d9d7
110 changed files with 149 additions and 136 deletions

View File

@@ -0,0 +1,20 @@
#include <drivers/InternalFlash.h>
#include <hal/nrf_rtc.h>
#include "FirmwareValidator.h"
using namespace Pinetime::Controllers;
bool FirmwareValidator::IsValidated() const {
auto* imageOkPtr = reinterpret_cast<uint32_t *>(validBitAdress);
return (*imageOkPtr) == validBitValue;
}
void FirmwareValidator::Validate() {
if(!IsValidated())
Pinetime::Drivers::InternalFlash::WriteWord(validBitAdress, validBitValue);
}
void FirmwareValidator::Reset() {
NVIC_SystemReset();
}

View File

@@ -0,0 +1,18 @@
#pragma once
#include <cstdint>
namespace Pinetime {
namespace Controllers {
class FirmwareValidator {
public:
void Validate();
bool IsValidated() const;
void Reset();
private:
static constexpr uint32_t validBitAdress {0x7BFE8};
static constexpr uint32_t validBitValue {1};
};
}
}