diff --git a/make.mk b/make.mk index 8c8863bcb..4834f5213 100644 --- a/make.mk +++ b/make.mk @@ -243,3 +243,5 @@ endif ifdef CLOCK_FACE_24H_ONLY CFLAGS += -DCLOCK_FACE_24H_ONLY endif + +CFLAGS += -g diff --git a/uv-calibration/dump-gdb b/uv-calibration/dump-gdb new file mode 100644 index 000000000..8eda80ae5 --- /dev/null +++ b/uv-calibration/dump-gdb @@ -0,0 +1,16 @@ +set pagination off + +target remote :2331 +monitor halt +monitor reset 2 +file build/watch.elf +#load + +break ../watch_faces/sensor/si1133_uv_face.c:186 +command 1 +p new_reading +append value raw/trace_log new_reading +continue +end + +continue diff --git a/uv-calibration/raw/trace_log b/uv-calibration/raw/trace_log new file mode 100644 index 000000000..a6f046216 Binary files /dev/null and b/uv-calibration/raw/trace_log differ diff --git a/uv-calibration/unpack.py b/uv-calibration/unpack.py new file mode 100644 index 000000000..01acc492a --- /dev/null +++ b/uv-calibration/unpack.py @@ -0,0 +1,19 @@ +""" +Turn gdb dump of uv readings from UV sensor watch into file +""" + +import argparse +import struct + +def main(filename: str): + with open(filename, "rb") as f: + buffer = f.read() + readings = [s[0] for s in struct.iter_unpack("