aboutsummaryrefslogtreecommitdiff
path: root/robot/mode_dirc.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-05 15:18:37 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-05 15:18:37 +0200
commit1f8a640303976ddcc3605a9b6af8fb398dc7c300 (patch)
tree0b94783ee69909c46e7272a8160ee441ea7cb0cf /robot/mode_dirc.c
parent8b2d83a74c7d23b8c745aa147836c257ded110a7 (diff)
`make format`
Diffstat (limited to 'robot/mode_dirc.c')
-rw-r--r--robot/mode_dirc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/robot/mode_dirc.c b/robot/mode_dirc.c
index b7df974..7021721 100644
--- a/robot/mode_dirc.c
+++ b/robot/mode_dirc.c
@@ -1,22 +1,25 @@
#include "mode_dirc.h"
-#include "io.h"
+#include "../shared/util.h"
#include "hypervisor.h"
+#include "io.h"
#include "modes.h"
-#include "../shared/util.h"
#include "orangutan_shim.h"
-#include <string.h>
#include "../shared/errcatch.h"
+#include <string.h>
int16_t g_w2_mode_dirc_motor_l = 0;
int16_t g_w2_mode_dirc_motor_r = 0;
-uint8_t g_w2_mode_dirc_power = 100;
+uint8_t g_w2_mode_dirc_power = 100;
void w2_mode_dirc() {
- if (g_w2_connected == 1) g_w2_mode_dirc_power = 100;
- else g_w2_mode_dirc_power = W2_MAX(0, g_w2_mode_dirc_power - 1);
+ if (g_w2_connected == 1)
+ g_w2_mode_dirc_power = 100;
+ else
+ g_w2_mode_dirc_power = W2_MAX(0, g_w2_mode_dirc_power - 1);
if (g_w2_mode_dirc_power == 0) w2_modes_call(W2_M_HALT);
- set_motors(g_w2_mode_dirc_motor_l * g_w2_mode_dirc_power / 100, g_w2_mode_dirc_motor_r * g_w2_mode_dirc_power / 100);
+ set_motors(g_w2_mode_dirc_motor_l * g_w2_mode_dirc_power / 100,
+ g_w2_mode_dirc_motor_r * g_w2_mode_dirc_power / 100);
}