Skip to content

Commit

Permalink
Merge pull request #176 from pycom/danicampora-patch-1
Browse files Browse the repository at this point in the history
Fix read_mac function for the ESP32
  • Loading branch information
projectgus authored Feb 8, 2017
2 parents 3fb8eb7 + 136de02 commit c1d0009
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,11 +900,11 @@ def chip_id(self):

def read_mac(self):
""" Read MAC from EFUSE region """
words = [self.read_efuse(1), self.read_efuse(2)]
words = [self.read_efuse(2), self.read_efuse(1)]
bitstring = struct.pack(">II", *words)
bitstring = bitstring[:6] # trim 2 byte CRC
bitstring = bitstring[2:8] # trim the 2 byte CRC
try:
return tuple(ord(b) for b in bitstring) # trim 2 byte CRC
return tuple(ord(b) for b in bitstring)
except TypeError: # Python 3, bitstring elements are already bytes
return tuple(bitstring)

Expand Down

0 comments on commit c1d0009

Please sign in to comment.