summaryrefslogtreecommitdiff
path: root/robot
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-29 18:58:28 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-29 18:58:28 +0200
commit92157948b61c866d842519a375000b3f812d2f12 (patch)
treee7e8db92bc303c08b14ccd15663729df2ce3bb42 /robot
parenta93bcdf20962a9fe32c1dd19aa820551ac13212d (diff)
`make format`
Diffstat (limited to 'robot')
-rw-r--r--robot/mode_chrg.c7
-rw-r--r--robot/mode_grid.c4
-rw-r--r--robot/mode_halt.c2
-rw-r--r--robot/mode_maze.c2
-rw-r--r--robot/mode_scal.c2
-rw-r--r--robot/mode_spin.c2
-rw-r--r--robot/movement.c2
7 files changed, 10 insertions, 11 deletions
diff --git a/robot/mode_chrg.c b/robot/mode_chrg.c
index dac6174..f75ce5f 100644
--- a/robot/mode_chrg.c
+++ b/robot/mode_chrg.c
@@ -1,7 +1,7 @@
#include "mode_chrg.h"
-#include "io.h"
#include "../shared/bool.h"
#include "hypervisor.h"
+#include "io.h"
#include "mode_grid.h"
#include "modes.h"
#include "movement.h"
@@ -53,7 +53,7 @@ bool w2_charge_cross_walk() {
void w2_mode_chrg() {
static unsigned int last_proportional = 0;
static long integral = 0;
- static bool g_w2_chrg_aligned = false;
+ static bool g_w2_chrg_aligned = false;
if (g_w2_chrg_aligned) {
if (g_w2_target_area == W2_AREA_CHRG) return;
@@ -88,7 +88,7 @@ void w2_mode_chrg() {
// Compute the actual motor settings. We never set either motor
// to a negative value.
-
+
const int max = 60;
if (power_difference > max) power_difference = max;
if (power_difference < -max) power_difference = -max;
@@ -126,4 +126,3 @@ void w2_mode_chrg() {
}
}
}
-
diff --git a/robot/mode_grid.c b/robot/mode_grid.c
index b6ed572..8a13f69 100644
--- a/robot/mode_grid.c
+++ b/robot/mode_grid.c
@@ -1,13 +1,13 @@
#include <stdio.h>
#include <string.h>
-#include "mode_grid.h"
+#include "../shared/errcatch.h"
#include "hypervisor.h"
#include "io.h"
+#include "mode_grid.h"
#include "modes.h"
#include "movement.h"
#include "orangutan_shim.h"
-#include "../shared/errcatch.h"
/**
* TODO: mode_grid g_w2_target_area laten volgen
diff --git a/robot/mode_halt.c b/robot/mode_halt.c
index 268a922..4ebcd99 100644
--- a/robot/mode_halt.c
+++ b/robot/mode_halt.c
@@ -1,6 +1,6 @@
#include "mode_halt.h"
-#include "orangutan_shim.h"
#include "io.h"
+#include "orangutan_shim.h"
// emergency stop
void w2_mode_halt() { w2_set_motors(0, 0); }
diff --git a/robot/mode_maze.c b/robot/mode_maze.c
index a7f76ec..db789cc 100644
--- a/robot/mode_maze.c
+++ b/robot/mode_maze.c
@@ -1,8 +1,8 @@
#include "mode_maze.h"
+#include "io.h"
#include "mode_grid.h"
#include "movement.h"
#include "orangutan_shim.h"
-#include "io.h"
unsigned int g_w2_last_proportional = 0;
long g_w2_integral = 0;
diff --git a/robot/mode_scal.c b/robot/mode_scal.c
index 245fec4..bb0473b 100644
--- a/robot/mode_scal.c
+++ b/robot/mode_scal.c
@@ -1,7 +1,7 @@
#include "mode_scal.h"
+#include "io.h"
#include "modes.h"
#include "orangutan_shim.h"
-#include "io.h"
// callibrates the robot
void w2_mode_scal() {
diff --git a/robot/mode_spin.c b/robot/mode_spin.c
index 1c7cc11..07618bd 100644
--- a/robot/mode_spin.c
+++ b/robot/mode_spin.c
@@ -1,6 +1,6 @@
#include "mode_spin.h"
-#include "orangutan_shim.h"
#include "io.h"
+#include "orangutan_shim.h"
// wet floor simulation
void w2_mode_spin() { w2_set_motors(255, -255); }
diff --git a/robot/movement.c b/robot/movement.c
index b800464..1ceb81e 100644
--- a/robot/movement.c
+++ b/robot/movement.c
@@ -1,6 +1,6 @@
#include "movement.h"
-#include "orangutan_shim.h"
#include "io.h"
+#include "orangutan_shim.h"
unsigned int g_w2_sensors[5] = {0}; // IR sensors on the bottom of the robot
unsigned int g_w2_position = 0; // position on the black line