Skip to content

Commit 484bd95

Browse files
committed
fix: Add 'Code' column to errormasks csv
1 parent d3d899a commit 484bd95

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

errormasks.csv

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Console,Type,Bitmask,Name,Description
2-
ALL,SMC,0xE000,FATAL,"FATAL SMC error"
3-
ALL,SMC,0xE400,THERMAL,"THERMAL SMC error"
4-
ALL,SMC,0xEA00,RESET,"RESET SMC error"
5-
ALL,SMC,0xEB00,BOOT,"BOOT SMC error"
6-
ALL,SMC,0xEC00,RUNTIME,"RUNTIME SMC error"
1+
Console,Type,Bitmask,Code,Name,Description
2+
ALL,SMC,0xFF00,0xE000,FATAL,"FATAL SMC error"
3+
ALL,SMC,0xFF00,0xE400,THERMAL,"THERMAL SMC error"
4+
ALL,SMC,0xFF00,0xEA00,RESET,"RESET SMC error"
5+
ALL,SMC,0xFF00,0xEB00,BOOT,"BOOT SMC error"
6+
ALL,SMC,0xFF00,0xEC00,RUNTIME,"RUNTIME SMC error"

scripts/csv_definition.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ErrorMaskDefinition:
6060
Console: List[str] | str
6161
Type: str
6262
Bitmask: int
63+
Code: int
6364
Name: str
6465
Description: str
6566

@@ -70,13 +71,15 @@ def validate(cls, row: dict):
7071
assert row["Type"] in ALL_CODE_TYPES
7172
assert row["Bitmask"].startswith("0x")
7273
assert int(row["Bitmask"], 16) is not None
74+
assert int(row["Code"], 16) is not None
7375
assert "Name" in row
7476
assert "Description" in row
7577
assert "rest" not in row, "Row was parsed incorrectly, is the description quoted properly?"
7678
return cls(
7779
Console=console,
7880
Type=row["Type"],
7981
Bitmask=int(row["Bitmask"], 16),
82+
Code=int(row["Code"], 16),
8083
Name=row["Name"],
8184
Description=row["Description"]
8285
)

0 commit comments

Comments
 (0)