1
0
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:
Karan Misra 2015-01-15 06:36:01 +05:30
parent bf6e647c1d
commit f54c110445

View File

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