aboutsummaryrefslogtreecommitdiff
path: root/robot/sercomm.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-29 09:34:54 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-29 09:34:54 +0200
commit4d446fb2c1d14142304971095ee60668ba9c6bc5 (patch)
treed5e5670f17a2d8a89748645b0739ef95dd6bf4f4 /robot/sercomm.c
parent0b50dfe730d87ff052ef08f0dd6df6071d50aef9 (diff)
[WIP] last touches for second assessment
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 0f251d2..16134d1 100644
--- a/robot/sercomm.c
+++ b/robot/sercomm.c
@@ -118,16 +118,20 @@ void w2_cmd_dirc_rx(w2_s_bin *data) {
void w2_cmd_cord_rx(w2_s_bin *data) { return; }
-// #include <stdio.h>
+#include <stdio.h>
void w2_cmd_bomd_rx(w2_s_bin *data) {
- /* W2_CAST_BIN(w2_s_cmd_bomd_rx, data, req);
+ W2_CAST_BIN(w2_s_cmd_bomd_rx, data, req);
+
+ req->position = w2_bin_hton32(req->position);
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;
- g_w2_order_index++; */
+ // sprintf(buf, "%lu, %lu", req->position % W2_MAP_DEFAULT_WIDTH, req->position / W2_MAP_DEFAULT_WIDTH);
+ sprintf(buf, "%lu", req->position);
+ 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++;
}
void w2_cmd_sres_rx(w2_s_bin *data) {