wangzhibo
2026-08-26 70481429367ca00144b24f118cbfdfb28b02967d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pathlib import Path
 
ROOT = Path(__file__).resolve().parents[1]
 
 
def read_text(path: str) -> str:
    return (ROOT / path).read_text(encoding="utf-8")
 
 
def require(condition: bool, message: str) -> None:
    if not condition:
        raise SystemExit(message)
 
 
def main() -> None:
    board = read_text("main/boards/sening-xiaozhi-s3/sening_xiaozhi_s3.cc")
    require(
        "SDCard_Restore_Last_JPG" not in board,
        "boot should not restore the last displayed JPG",
    )
 
 
if __name__ == "__main__":
    main()