mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +01:00
support detection on rpi b+
This commit is contained in:
parent
bf6e647c1d
commit
f54c110445
10
detect.go
10
detect.go
@ -83,15 +83,17 @@ func cpuInfo() (model, hardware string, revision int, err error) {
|
|||||||
if len(fields) < 1 {
|
if len(fields) < 1 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(fields[0], "Revision") {
|
switch {
|
||||||
rev, err := strconv.ParseInt(fields[1], 16, 8)
|
case strings.HasPrefix(fields[0], "Revision"):
|
||||||
|
revs := strings.TrimSpace(fields[1])
|
||||||
|
rev, err := strconv.ParseInt(revs, 16, 8)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
revision = int(rev)
|
revision = int(rev)
|
||||||
} else if strings.HasPrefix(fields[0], "Hardware") {
|
case strings.HasPrefix(fields[0], "Hardware"):
|
||||||
hardware = fields[1]
|
hardware = fields[1]
|
||||||
} else if strings.HasPrefix(fields[0], "model name") {
|
case strings.HasPrefix(fields[0], "model name"):
|
||||||
model = fields[1]
|
model = fields[1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user