diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-26 13:04:35 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-26 13:04:35 +0200 |
commit | f7387fd6af14a740f474620555de379bc9ba69db (patch) | |
tree | 4e98ac46f97dc7dbdb007b5e1282cd9a727080cb /robot/sim.c | |
parent | 4487ce5c3083d95fad26ebca790b0f849821d736 (diff) |
forward errors to sercomm (implement expt command
Diffstat (limited to 'robot/sim.c')
-rw-r--r-- | robot/sim.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/robot/sim.c b/robot/sim.c index 0cde6a0..baf8a8a 100644 --- a/robot/sim.c +++ b/robot/sim.c @@ -9,6 +9,7 @@ #include "../shared/consts.h" #include "../shared/protocol.h" #include "sercomm.h" +#include "errcatch.h" struct timespec reference_time; // NOLINT bool g_w2_sim_headless = false; @@ -74,10 +75,10 @@ void serial_send(char* message, unsigned int length) { putc(message[byte] & 0xff, stdout); return; } - if (!DBG_ENABLE_PRINTFUNC) return; - simprintfunc("serial_send", "<see below>, %u", length); + if (DBG_ENABLE_PRINTFUNC) simprintfunc("serial_send", "<see below>, %u", length); + if (!DBG_ENABLE_SERIAL) return; w2_s_bin *bin = w2_bin_s_alloc(length, (uint8_t*) message); w2_sim_print_serial(bin); free(bin); @@ -103,6 +104,9 @@ void w2_sim_setup(int argc, char **argv) { term.c_cc[VTIME] = 0; term.c_cc[VMIN] = 0; tcsetattr(STDIN_FILENO, 0, &term); + + // debug error + // w2_errcatch_throw(W2_E_WARN_BATTERY_LOW); } void w2_sim_cycle_begin() { |