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
|
falcon (1.0.1-101pika1) pika; urgency=low
|
||||||
|
|
||||||
* Initial release
|
* Initial release
|
||||||
|
17
main.go
17
main.go
@ -204,18 +204,27 @@ func GetPPStatusAndHighestCores() (bool, []CoreFreq, bool, []int, error) {
|
|||||||
return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
|
return fmt.Errorf("failed to unmarshal lscpu output: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxMHz float64
|
sort.Slice(lscpuOutput.CPUs, func(i, j int) bool {
|
||||||
|
return lscpuOutput.CPUs[i].MaxMHz > lscpuOutput.CPUs[j].MaxMHz
|
||||||
|
})
|
||||||
|
|
||||||
|
if len(lscpuOutput.CPUs) > 0 {
|
||||||
|
topMHz := lscpuOutput.CPUs[0].MaxMHz
|
||||||
|
secondMHz := topMHz
|
||||||
|
|
||||||
for _, cpu := range lscpuOutput.CPUs {
|
for _, cpu := range lscpuOutput.CPUs {
|
||||||
if cpu.MaxMHz > maxMHz {
|
if cpu.MaxMHz < topMHz {
|
||||||
maxMHz = cpu.MaxMHz
|
secondMHz = cpu.MaxMHz
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, cpu := range lscpuOutput.CPUs {
|
for _, cpu := range lscpuOutput.CPUs {
|
||||||
if cpu.MaxMHz == maxMHz {
|
if cpu.MaxMHz == topMHz || cpu.MaxMHz == secondMHz {
|
||||||
highestCores = append(highestCores, cpu.CPU)
|
highestCores = append(highestCores, cpu.CPU)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user