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()
|