diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-26 15:39:31 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-26 15:39:31 +0200 |
commit | 60f07661602a5dfe8e39b8038964b38bddcb33a5 (patch) | |
tree | 0b257acda0797a13cd09e7df2d16a6da0a6aef11 /robot/setup.c | |
parent | 333eea840a17d0f8ecf0110d952df2857fea4da0 (diff) | |
parent | f073c9d3848dab915bed4844e9d13684aa5e23eb (diff) |
merge dev into master
Diffstat (limited to 'robot/setup.c')
-rw-r--r-- | robot/setup.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/robot/setup.c b/robot/setup.c index c74cca9..06c8fa4 100644 --- a/robot/setup.c +++ b/robot/setup.c @@ -1,13 +1,20 @@ #include <stdlib.h> -#include "consts.h" -#include "halt.h" +#include "../shared/bin.h" +#include "../shared/consts.h" #include "modes.h" #include "orangutan_shim.h" +#include "sercomm.h" #include "setup.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() { - serial_set_baud_rate(W2_SERIAL_BAUD); + // check endianness + g_w2_endianness = *_ptest; // reset underside leds red_led(0); @@ -16,6 +23,17 @@ void w2_setup_main() { // clear lcd clear(); + // start serial i/o + w2_cmd_setup_handlers(); + serial_set_baud_rate(W2_SERIAL_BAUD); + serial_receive_ring(g_w2_serial_buffer, W2_SERIAL_READ_BUFFER_SIZE); + + // reset timer + time_reset(); + + // set default mode + w2_modes_swap(W2_M_HALT); + // indicate startup done play("L50 c>c"); } |