diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-05 15:18:37 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-05 15:18:37 +0200 |
commit | 1f8a640303976ddcc3605a9b6af8fb398dc7c300 (patch) | |
tree | 0b94783ee69909c46e7272a8160ee441ea7cb0cf /robot/errcatch.c | |
parent | 8b2d83a74c7d23b8c745aa147836c257ded110a7 (diff) |
`make format`
Diffstat (limited to 'robot/errcatch.c')
-rw-r--r-- | robot/errcatch.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/robot/errcatch.c b/robot/errcatch.c index 77fcfd3..17c96fa 100644 --- a/robot/errcatch.c +++ b/robot/errcatch.c @@ -20,17 +20,20 @@ void w2_errcatch_handle_error(w2_s_error *error) { g_w2_error_uncaught = true; #ifdef W2_SIM simwarn("Uncaught/unhandled error found with code 0x%02x", error->code); - if (error->message_length > 0) fprintf(stderr, " and message \"%.*s\"", error->message_length, error->message); + if (error->message_length > 0) + fprintf(stderr, " and message \"%.*s\"", error->message_length, error->message); fprintf(stderr, "\n"); #endif } } // forward error to sercomm - W2_CREATE_MSG_SIZE_BIN(w2_s_cmd_expt_tx, sizeof(w2_s_cmd_expt_tx) + sizeof(uint8_t) * error->message_length, msg, msg_bin); - msg->opcode = W2_CMD_EXPT | W2_CMDDIR_TX; - msg->error = error->code; - msg->length = error->message_length; + W2_CREATE_MSG_SIZE_BIN(w2_s_cmd_expt_tx, + sizeof(w2_s_cmd_expt_tx) + sizeof(uint8_t) * error->message_length, msg, + msg_bin); + msg->opcode = W2_CMD_EXPT | W2_CMDDIR_TX; + msg->error = error->code; + msg->length = error->message_length; memcpy(msg->message, error->message, error->message_length); w2_sercomm_append_msg(msg_bin); |