Created
January 12, 2024 01:11
-
-
Save etenzy/d9e7275e75781455054543f3dbfc4e96 to your computer and use it in GitHub Desktop.
translate raspberry pi revcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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