Skip to content

Instantly share code, notes, and snippets.

@etenzy
Created January 12, 2024 01:11
Show Gist options
  • Save etenzy/d9e7275e75781455054543f3dbfc4e96 to your computer and use it in GitHub Desktop.
Save etenzy/d9e7275e75781455054543f3dbfc4e96 to your computer and use it in GitHub Desktop.
translate raspberry pi revcodes
import subprocess
import sys
revcode = sys.argv[1]
code = int(revcode, 16)
new = (code >> 23) & 0x1
model = (code >> 4) & 0xff
mem = (code >> 20) & 0x7
print("revcode:", revcode)
print("new:", hex(new))
print("model:", hex(model))
print("mem:", hex(mem))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment