주석 추가
This commit is contained in:
parent
2d0aaf58a5
commit
0f53bcbe20
|
@ -8,6 +8,7 @@ import (
|
|||
"amuz.es/src/infra/cpu_ctrl/processor"
|
||||
"amuz.es/src/infra/cpu_ctrl/logger"
|
||||
"bytes"
|
||||
"golang.org/x/tools/go/gcimporter15/testdata"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -45,6 +46,7 @@ func (c *fanControl) StartControl() {
|
|||
}
|
||||
}()
|
||||
defer close(c.fanSpeedConsumer)
|
||||
log.Info("Fan control started")
|
||||
|
||||
ticker := time.Tick(c.sampleDuration)
|
||||
fanSpeedList := make([]int, c.processorCount)
|
||||
|
@ -64,10 +66,7 @@ func (c *fanControl) StartControl() {
|
|||
if (!compareFanSpeed(fanSpeedList, newFanSpeedList)) {
|
||||
fanSpeedList = newFanSpeedList
|
||||
args := make([]string, 0)
|
||||
args = append(args,
|
||||
"raw",
|
||||
"0x3a", "0x01",
|
||||
)
|
||||
args = append(args,"raw","0x3a", "0x01",)
|
||||
for _, item := range fanSpeedList {
|
||||
args = append(args, fmt.Sprintf("0x%x", item))
|
||||
}
|
||||
|
|
|
@ -160,9 +160,9 @@ func (p *processor) StartMonitoring() {
|
|||
}:
|
||||
default:
|
||||
}
|
||||
log.Infof("processor %d : fan changed 0x%x", p.id, fanspeed)
|
||||
}
|
||||
p.fanSpeed = fanspeed
|
||||
log.Infof("processor %d : fan changed 0x%x", p.id, fanspeed)
|
||||
}
|
||||
case <-p.handler.Done():
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue