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