File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed
Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -178,19 +178,18 @@ def _pi_rev_code(self):
178178 return None
179179 return self .detector .get_cpuinfo_field ('Revision' )
180180
181- @property
182181 def _beaglebone_id (self ):
183182 """Try to detect id of a Beaglebone."""
184183 try :
185184 with open ("/sys/bus/nvmem/devices/0-00500/nvmem" , "rb" ) as eeprom :
186185 eeprom_bytes = eeprom .read (16 )
187- except :
186+ except FileNotFoundError :
188187 return None
189188
190189 if eeprom_bytes [:4 ] != b'\xaa U3\xee ' :
191190 return None
192191
193- id_string = str ( eeprom_bytes [4 :])
192+ id_string = eeprom_bytes [4 :]. decode ( "ascii" )
194193 for model , ids in _BEAGLEBONE_BOARD_IDS .items ():
195194 for id in ids :
196195 if id_string == id [1 ]:
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ def _linux_id(self):
3333 hardware = self .detector .get_cpuinfo_field ("Hardware" )
3434 if hardware in ('BCM2708' , 'BCM2708' , 'BCM2835' ):
3535 id = BCM2XXX
36- elif "AM33XX" in hardwarename :
36+ elif "AM33XX" in hardware :
3737 id = AM33XX
38- elif "sun8i" in hardwarename :
38+ elif "sun8i" in hardware :
3939 id = SUN8I
4040
4141 return id
Original file line number Diff line number Diff line change 1515 print ("Raspberry Pi detected." )
1616 print ("Revision code: " , detector .board ._pi_rev_code ())
1717
18- if detector .board .beaglebone_black :
18+ if detector .board .BEAGLEBONE_BLACK :
1919 print ("BBB detected" )
You can’t perform that action at this time.
0 commit comments