microReticulumTbeam/exercises/11_Set_RTC2GPS/scripts/set_build_epoch.py
John Poole c324998ef0 Coordinates and altitude captured along with build version. Sample log:
20260217_212053_z        set RTC to GPS using 1PPS pulse-per-second discipline  rtc-gps drift=+0 s; sats=20; lat=44.936488 lon=-123.021837; alt_m=59.1; hdop=0.7; utc_age_ms=659; pps_edges=805; fw_epoch=1771362221; fw_build_utc=20260217_210341_z
2026-02-17 13:24:28 -08:00

12 lines
241 B
Python

import time
Import("env")
epoch = int(time.time())
utc_tag = time.strftime("%Y%m%d_%H%M%S_z", time.gmtime(epoch))
env.Append(
CPPDEFINES=[
("FW_BUILD_EPOCH", str(epoch)),
("FW_BUILD_UTC", '\\"%s\\"' % utc_tag),
]
)