In case of two-byte values, trigger only on last byte.
h3rald h3rald@h3rald.com
Tue, 21 Jul 2026 15:06:06 +0200
2 files changed,
6 insertions(+),
4 deletions(-)
M
devices/clock.c
→
devices/clock.c
@@ -177,8 +177,9 @@ void clock_output(xyw_byte *data, xyw_byte addr, xyw_byte *error)
{ (void)error; - // When writing to CLOCK_TIMER or CLOCK_TIMER+1, start/restart the timer - if (addr == CLOCK_TIMER || addr == CLOCK_TIMER + 1) + /* When writing to CLOCK_TIMER+1 (check only last byte, so that this doesn't get fired twice, + once for each byte), start/restart the timer */ + if (addr == CLOCK_TIMER + 1) { // Read the full 16-bit timer value from device data xyw_word timer_val = XYW_PEEKW(&data[CLOCK_TIMER]);
M
devices/file.c
→
devices/file.c
@@ -484,8 +484,9 @@ }
void file_output(xyw_byte *data, xyw_byte addr, xyw_byte *error) { - /* When path is written, close current file, update stats, reset cursor */ - if (addr == FILE_PATH || addr == FILE_PATH + 1) + /* When path is written (check only last byte, so that this doesn't get fired twice, + once for each byte), close current file, update stats, reset cursor */ + if (addr == FILE_PATH + 1) { file_close(); update_file_stats(data);