summaryrefslogtreecommitdiff
path: root/robot/setup.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-17 21:21:00 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-17 21:21:00 +0200
commit365dcc18fbd98645585cdbe009f537ecdaa90c1a (patch)
tree078c14da20867e177d658ae4cc517b81ab9ad1aa /robot/setup.c
parentf00fca5f6f9751b16d868f52bda908c7b4704457 (diff)
WIP sercomm implementation
- moved some module-specific constants to their respective header files - changed .clang-tidy to ignore global private global constants (starting with `_`) - suppressed some GCC warnings in bin.c and all pololu library warnings - added function signatures for sercomm protocol data generators - added endianness check in setup.c
Diffstat (limited to 'robot/setup.c')
-rw-r--r--robot/setup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/robot/setup.c b/robot/setup.c
index c74cca9..bdd5991 100644
--- a/robot/setup.c
+++ b/robot/setup.c
@@ -5,8 +5,17 @@
#include "modes.h"
#include "orangutan_shim.h"
#include "setup.h"
+#include "bin.h"
+
+// pointers for endianness check
+static const uint16_t _test = 1;
+static const uint8_t* _ptest = (uint8_t*)&_test;
+uint8_t g_w2_endianness;
void w2_setup_main() {
+ // check endianness
+ g_w2_endianness = *_ptest;
+
serial_set_baud_rate(W2_SERIAL_BAUD);
// reset underside leds