diff --git a/Changelog.md b/Changelog.md index 0b367b7..badef62 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,11 @@ +## NEXT - unreleased + +EXPERIMENTAL RELEASE + +### Changed + +- Showing only the voltage presets that are in range + ## 0.1.10 - 2024-03-06 EXPERIMENTAL RELEASE diff --git a/src/features/VoltageConfiguration/VoltageConfiguration.tsx b/src/features/VoltageConfiguration/VoltageConfiguration.tsx index e9198c7..0da874c 100644 --- a/src/features/VoltageConfiguration/VoltageConfiguration.tsx +++ b/src/features/VoltageConfiguration/VoltageConfiguration.tsx @@ -40,6 +40,15 @@ const VoltageConfiguration = ({ pmicPortDescription ?? `Set voltage for PMIC port ${pmicPort} (${label})`; + // Voltage presets in lieu of presets in board definition files + const voltagePresetValues = [1200, 1800, 3300, 2500, 1500] + .filter( + filterVoltage => + filterVoltage >= voltageMin && filterVoltage <= voltageMax + ) + .slice(0, 3) + .sort((a, b) => a - b); + return ( {description}

)} -
- - - -
+ + +
( +
+ {voltages.map(voltage => ( + + ))} +
+); + +interface PresetButtonProps { + pmicPort: number; + voltage: number; +} + +const PresetButton = ({ pmicPort, voltage }: PresetButtonProps) => { + const dispatch = useDispatch(); + + return ( + + ); +}; + export default VoltageConfiguration;