Align board project names with board ids (#399)
To avoid keeping track of a list that maps board project names to board ids. Because of this change, we don't have to manually edit `boards.cmake` anymore when adding a new board.
This commit is contained in:
committed by
GitHub
parent
efd3c6041c
commit
61277e74b8
@@ -0,0 +1,36 @@
|
||||
#include "SimulatorPower.h"
|
||||
|
||||
constexpr auto* TAG = "SimulatorPower";
|
||||
|
||||
bool SimulatorPower::supportsMetric(MetricType type) const {
|
||||
switch (type) {
|
||||
using enum MetricType;
|
||||
case IsCharging:
|
||||
case Current:
|
||||
case BatteryVoltage:
|
||||
case ChargeLevel:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false; // Safety guard for when new enum values are introduced
|
||||
}
|
||||
|
||||
bool SimulatorPower::getMetric(MetricType type, MetricData& data) {
|
||||
switch (type) {
|
||||
using enum MetricType;
|
||||
case IsCharging:
|
||||
data.valueAsBool = true;
|
||||
return true;
|
||||
case Current:
|
||||
data.valueAsInt32 = 42;
|
||||
return true;
|
||||
case BatteryVoltage:
|
||||
data.valueAsUint32 = 4032;
|
||||
return true;
|
||||
case ChargeLevel:
|
||||
data.valueAsUint8 = 100;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false; // Safety guard for when new enum values are introduced
|
||||
}
|
||||
Reference in New Issue
Block a user