summaryrefslogtreecommitdiff
path: root/robot/sercomm.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-24 11:42:23 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-24 11:42:23 +0200
commit40f6164ba6187a0160af9fe200bbd1d729e8c03b (patch)
tree84246633f40cb0c5d858168f63a5933d18006db3 /robot/sercomm.c
parent2e537232404bf5123bc92e7218156ec03160c68f (diff)
added TARQ to robot and client
Diffstat (limited to 'robot/sercomm.c')
-rw-r--r--robot/sercomm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/robot/sercomm.c b/robot/sercomm.c
index d12fcca..195c477 100644
--- a/robot/sercomm.c
+++ b/robot/sercomm.c
@@ -4,10 +4,10 @@
#include "../shared/bin.h"
#include "../shared/errcatch.h"
#include "../shared/serial_parse.h"
-#include "mode_grid.h"
#include "hypervisor.h"
#include "io.h"
#include "mode_dirc.h"
+#include "mode_grid.h"
#include "modes.h"
#include "orangutan_shim.h"
#include "sercomm.h"
@@ -124,10 +124,9 @@ void w2_cmd_bomd_rx(w2_s_bin *data) {
char buf[32];
clear();
- sprintf(buf, "%lu, %lu", req->position % W2_MAP_DEFAULT_WIDTH, req->position / W2_MAP_DEFAULT_WIDTH);
- print(buf);
- g_w2_order[g_w2_order_index].x = req->position % W2_MAP_DEFAULT_WIDTH;
- g_w2_order[g_w2_order_index].y = req->position / W2_MAP_DEFAULT_WIDTH;
+ sprintf(buf, "%lu, %lu", req->position % W2_MAP_DEFAULT_WIDTH, req->position /
+ W2_MAP_DEFAULT_WIDTH); print(buf); g_w2_order[g_w2_order_index].x = req->position %
+ W2_MAP_DEFAULT_WIDTH; g_w2_order[g_w2_order_index].y = req->position / W2_MAP_DEFAULT_WIDTH;
g_w2_order_index++; */
}
@@ -161,7 +160,7 @@ void w2_cmd_info_rx(w2_s_bin *data) {
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->mode = g_w2_mode_history[g_w2_mode_history_index];
- res_msg->battery_mv = w2_bin_hton16(read_battery_millivolts());
+ res_msg->battery_mv = w2_bin_hton16(read_battery_millivolts());
w2_sercomm_append_msg(res_bin);
free(res_bin);
@@ -173,6 +172,11 @@ void w2_cmd_play_rx(w2_s_bin *data) { return; }
void w2_cmd_cled_rx(w2_s_bin *data) { return; }
+void w2_cmd_tarq_rx(w2_s_bin *data) {
+ W2_CAST_BIN(w2_s_cmd_tarq_rx, data, req);
+ g_w2_target_area = req->target_area;
+}
+
#pragma GCC diagnostic pop
void w2_cmd_expt_tx(w2_s_bin *data) {}