mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
Switches the HAL structs to use unique_ptr (#183)
This commit is contained in:
committed by
Peter Johnson
parent
1ca291f20b
commit
0901ae0808
@@ -7,13 +7,15 @@
|
||||
|
||||
#include "HAL/Power.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ChipObject.h"
|
||||
|
||||
static tPower* power = nullptr;
|
||||
static std::unique_ptr<tPower> power;
|
||||
|
||||
static void initializePower(int32_t* status) {
|
||||
if (power == nullptr) {
|
||||
power = tPower::create(status);
|
||||
power.reset(tPower::create(status));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user