Skip to content

Commit

Permalink
Merge pull request #5 from Emiliopg91/feature/DefaultCustomTDPValues
Browse files Browse the repository at this point in the history
Default Custom TDP equals to Performance mode
  • Loading branch information
Emiliopg91 authored Sep 13, 2024
2 parents 35d297e + a05c112 commit 4057a46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/components/cpuBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,13 @@ export const CpuBlock: FC = () => {
}, [id])

const onModeChange = (newVal: number) => {
if (newVal == modeTags.indexOf(Mode[Mode.CUSTOM])) {
saveSettings(id, name, newVal, spl, sppl, fppl, cpuBoost, smtEnabled)
} else {
const tdps = Profiles.getTdpForMode(newVal)
saveSettings(id, name, newVal, tdps[0], tdps[1], tdps[2], cpuBoost, smtEnabled)

setSpl(tdps[0])
setSppl(tdps[1])
setFppl(tdps[2])
}
let tdps = Profiles.getTdpForMode(newVal)

saveSettings(id, name, newVal, tdps[0], tdps[1], tdps[2], cpuBoost, smtEnabled)

setSpl(tdps[0])
setSppl(tdps[1])
setFppl(tdps[2])
setMode(newVal)
}

Expand Down
1 change: 1 addition & 0 deletions src/settings/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class Profiles {
fppl = Constants.AllySilentFPPL
break;
case Mode.PERFORMANCE:
case Mode.CUSTOM:
spl = State.IS_ALLY_X ? Constants.AllyXPerformanceSPL : Constants.AllyPerformanceSPL
sppl = Constants.AllyPerformanceSPPL
fppl = Constants.AllyPerformanceFPPL
Expand Down

0 comments on commit 4057a46

Please sign in to comment.