Fix intel
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 28s
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 28s
This commit is contained in:
parent
861de368d7
commit
ed2c2eb112
2
.github/release-nest-v3
vendored
2
.github/release-nest-v3
vendored
@ -1 +1 @@
|
||||
1
|
||||
2
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
||||
falcon (1.0.2-101pika1) pika; urgency=low
|
||||
|
||||
* Fix Intel
|
||||
|
||||
-- Ward Nakchbandi <hotrod.master@hotmail.com> Sat, 10 Dec 2022 13:48:00 +0300
|
||||
|
||||
falcon (1.0.1-101pika1) pika; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
27
main.go
27
main.go
@ -204,16 +204,25 @@ func GetPPStatusAndHighestCores() (bool, []CoreFreq, bool, []int, error) {
|
||||
return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
|
||||
}
|
||||
|
||||
var maxMHz float64
|
||||
for _, cpu := range lscpuOutput.CPUs {
|
||||
if cpu.MaxMHz > maxMHz {
|
||||
maxMHz = cpu.MaxMHz
|
||||
}
|
||||
}
|
||||
sort.Slice(lscpuOutput.CPUs, func(i, j int) bool {
|
||||
return lscpuOutput.CPUs[i].MaxMHz > lscpuOutput.CPUs[j].MaxMHz
|
||||
})
|
||||
|
||||
for _, cpu := range lscpuOutput.CPUs {
|
||||
if cpu.MaxMHz == maxMHz {
|
||||
highestCores = append(highestCores, cpu.CPU)
|
||||
if len(lscpuOutput.CPUs) > 0 {
|
||||
topMHz := lscpuOutput.CPUs[0].MaxMHz
|
||||
secondMHz := topMHz
|
||||
|
||||
for _, cpu := range lscpuOutput.CPUs {
|
||||
if cpu.MaxMHz < topMHz {
|
||||
secondMHz = cpu.MaxMHz
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for _, cpu := range lscpuOutput.CPUs {
|
||||
if cpu.MaxMHz == topMHz || cpu.MaxMHz == secondMHz {
|
||||
highestCores = append(highestCores, cpu.CPU)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user