1
0
Fork 0

주석 추가

This commit is contained in:
Sangbum Kim 2017-09-11 00:56:01 +09:00
parent 2d0aaf58a5
commit 0f53bcbe20
2 changed files with 4 additions and 5 deletions

View File

@ -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))
}

View File

@ -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