summaryrefslogtreecommitdiff
path: root/robot/sercomm.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-29 22:35:04 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-29 22:35:04 +0200
commit555e5d2c0ce77dd1e031690c98ec9a1366182347 (patch)
tree69a505a23ae6ca5d0951e8f832f9895fcbb88b83 /robot/sercomm.c
parent87d8b0ceb349e101b693cf43336a98647f4b92dc (diff)
`make format`
Diffstat (limited to 'robot/sercomm.c')
-rw-r--r--robot/sercomm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/robot/sercomm.c b/robot/sercomm.c
index 5ac9a87..2317d89 100644
--- a/robot/sercomm.c
+++ b/robot/sercomm.c
@@ -2,8 +2,8 @@
#include <string.h>
#include "../shared/bin.h"
-#include "../shared/serial_parse.h"
#include "../shared/errcatch.h"
+#include "../shared/serial_parse.h"
#include "hypervisor.h"
#include "io.h"
#include "mode_dirc.h"
@@ -65,8 +65,8 @@ void w2_cmd_ping_rx(w2_s_bin *data) {
W2_CAST_BIN(w2_s_cmd_ping_rx, data, req);
W2_CREATE_MSG_BIN(w2_s_cmd_ping_tx, res_msg, res_bin);
- res_msg->opcode = W2_CMD_PING | W2_CMDDIR_TX;
- res_msg->id = req->id;
+ res_msg->opcode = W2_CMD_PING | W2_CMDDIR_TX;
+ res_msg->id = req->id;
w2_sercomm_append_msg(res_bin);
free(res_bin);
@@ -112,7 +112,7 @@ void w2_cmd_mcfg_rx(w2_s_bin *data) { return; }
void w2_cmd_sens_rx(w2_s_bin *data) {
W2_CREATE_MSG_BIN(w2_s_cmd_sens_tx, res_msg, res_bin);
- res_msg->opcode = W2_CMD_SENS | W2_CMDDIR_TX;
+ res_msg->opcode = W2_CMD_SENS | W2_CMDDIR_TX;
memcpy((uint8_t *)&res_msg->io, (uint8_t *)&g_w2_io, sizeof(w2_s_io_all));
for (int i = 0; i < 5; i++) w2_bin_repl_hton16(&res_msg->io.qtr[i].range);
@@ -128,13 +128,13 @@ void w2_cmd_sens_rx(w2_s_bin *data) {
void w2_cmd_info_rx(w2_s_bin *data) {
W2_CREATE_MSG_BIN(w2_s_cmd_info_tx, res_msg, res_bin);
- res_msg->opcode = W2_CMD_INFO | W2_CMDDIR_TX;
+ res_msg->opcode = W2_CMD_INFO | W2_CMDDIR_TX;
strncpy((char *)res_msg->build_str, W2_BUILD_STR, sizeof(res_msg->build_str));
res_msg->errcatch_ms = (uint8_t)g_w2_hypervisor_ema_errcatch_ms;
- res_msg->io_ms = (uint8_t)g_w2_hypervisor_ema_io_ms;
- res_msg->sercomm_ms = (uint8_t)g_w2_hypervisor_ema_sercomm_ms;
- res_msg->mode_ms = (uint8_t)g_w2_hypervisor_ema_mode_ms;
- res_msg->uptime_s = w2_bin_hton32((uint32_t)(g_w2_hypervisor_uptime_ms / 1e3));
+ res_msg->io_ms = (uint8_t)g_w2_hypervisor_ema_io_ms;
+ res_msg->sercomm_ms = (uint8_t)g_w2_hypervisor_ema_sercomm_ms;
+ res_msg->mode_ms = (uint8_t)g_w2_hypervisor_ema_mode_ms;
+ res_msg->uptime_s = w2_bin_hton32((uint32_t)(g_w2_hypervisor_uptime_ms / 1e3));
w2_sercomm_append_msg(res_bin);
free(res_bin);