Make the HAL self initialize when ever any initialization function is called (#1012)

This commit is contained in:
Thad House
2018-05-13 22:02:47 -07:00
committed by Peter Johnson
parent 59a8e9da57
commit e21a246a4d
50 changed files with 149 additions and 2 deletions

View File

@@ -10,6 +10,7 @@
#include <memory>
#include "HAL/ChipObject.h"
#include "HALInitializer.h"
using namespace hal;
@@ -18,6 +19,7 @@ namespace hal {
static std::unique_ptr<tPower> power{nullptr};
static void initializePower(int32_t* status) {
hal::init::CheckInit();
if (power == nullptr) {
power.reset(tPower::create(status));
}