5 VERSION_STRING =
"WebIOPi/%s/Python%d.%d" % (VERSION, sys.version_info.major, sys.version_info.minor)
6 PYTHON_MAJOR = sys.version_info.major
9 _MAPPING = [[], [], [], []]
10 _MAPPING[1] = [
"V33",
"V50", 0,
"V50", 1,
"GND", 4, 14,
"GND", 15, 17, 18, 21,
"GND", 22, 23,
"V33", 24, 10,
"GND", 9, 25, 11, 8,
"GND", 7]
11 _MAPPING[2] = [
"V33",
"V50", 2,
"V50", 3,
"GND", 4, 14,
"GND", 15, 17, 18, 27,
"GND", 22, 23,
"V33", 24, 10,
"GND", 9, 25, 11, 8,
"GND", 7]
12 _MAPPING[3] = [
"V33",
"V50", 2,
"V50", 3,
"GND", 4, 14,
"GND", 15, 17, 18, 27,
"GND", 22, 23,
"V33", 24, 10,
"GND", 9, 25, 11, 8,
"GND", 7,
"DNC",
"DNC" , 5,
"GND", 6, 12, 13,
"GND", 19, 16, 26, 20,
"GND", 21]
16 with open(
"/proc/cpuinfo")
as f:
17 rc = re.compile(
"Revision\s*:\s(.*)\n")
19 result = rc.search(info)
21 hex_cpurev = result.group(1)
22 if hex_cpurev.startswith(
"1000"):
23 hex_cpurev = hex_cpurev[-4:]
24 cpurev = int(hex_cpurev, 16)
35 MAPPING = _MAPPING[BOARD_REVISION]