aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/strings.c4
-rw-r--r--client/ui_dirc.c4
-rw-r--r--client/ui_orders.c2
-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
-rw-r--r--shared/bin.c8
-rw-r--r--shared/consts.h1
12 files changed, 18 insertions, 22 deletions
diff --git a/client/strings.c b/client/strings.c
index 29ca725..452baf4 100644
--- a/client/strings.c
+++ b/client/strings.c
@@ -57,7 +57,7 @@ void w2_strings_errors_internal() {
g_w2_error_internal_strings[W2_E_WARN_SERIAL_NOISY] = W2_UI_ERROR_INT_W2_E_WARN_SERIAL_NOISY;
g_w2_error_internal_strings[W2_E_WARN_MODE_HISTORY_BUFFER_IOB] =
W2_UI_ERROR_INT_W2_E_WARN_MODE_HISTORY_BUFFER_IOB;
- g_w2_error_internal_strings[W2_E_WARN_PING_TIMEOUT] = W2_UI_ERROR_INT_W2_E_WARN_PING_TIMEOUT;
+ g_w2_error_internal_strings[W2_E_WARN_PING_TIMEOUT] = W2_UI_ERROR_INT_W2_E_WARN_PING_TIMEOUT;
g_w2_error_internal_strings[W2_E_INFO_ORDER_ARRIVED] = W2_UI_ERROR_INT_W2_E_INFO_ORDER_ARRIVED;
}
@@ -82,7 +82,7 @@ void w2_strings_errors_user() {
g_w2_error_user_strings[W2_E_WARN_SERIAL_NOISY] = W2_UI_ERROR_USR_W2_E_WARN_SERIAL_NOISY;
g_w2_error_user_strings[W2_E_WARN_MODE_HISTORY_BUFFER_IOB] =
W2_UI_ERROR_USR_W2_E_WARN_MODE_HISTORY_BUFFER_IOB;
- g_w2_error_user_strings[W2_E_WARN_PING_TIMEOUT] = W2_UI_ERROR_USR_W2_E_WARN_PING_TIMEOUT;
+ g_w2_error_user_strings[W2_E_WARN_PING_TIMEOUT] = W2_UI_ERROR_USR_W2_E_WARN_PING_TIMEOUT;
g_w2_error_user_strings[W2_E_INFO_ORDER_ARRIVED] = W2_UI_ERROR_USR_W2_E_INFO_ORDER_ARRIVED;
}
diff --git a/client/ui_dirc.c b/client/ui_dirc.c
index 58e3576..48dee84 100644
--- a/client/ui_dirc.c
+++ b/client/ui_dirc.c
@@ -48,9 +48,7 @@ int w2_avg(int *samples, unsigned int sample_count) {
W2_DIRC_MOTOR_DRIVER(l);
W2_DIRC_MOTOR_DRIVER(r);
-void w2_ui_dirc_init() {
- return;
-}
+void w2_ui_dirc_init() { return; }
void w2_ui_bar_graph(unsigned int y, unsigned int x, unsigned int width, double value) {
char temp[width];
diff --git a/client/ui_orders.c b/client/ui_orders.c
index 6357c03..c01c162 100644
--- a/client/ui_orders.c
+++ b/client/ui_orders.c
@@ -64,7 +64,7 @@ void w2_ui_orders_cmd_send() {
for (int i = 0; i < g_w2_order_buffer_index; i++) {
W2_CREATE_MSG_BIN(w2_s_cmd_bomd_rx, msg, bin);
- msg->opcode = W2_CMD_BOMD | W2_CMDDIR_RX;
+ msg->opcode = W2_CMD_BOMD | W2_CMDDIR_RX;
msg->id = w2_bin_hton32(rand());
msg->position = w2_bin_hton32(g_w2_order_buffer[i]);
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
diff --git a/shared/bin.c b/shared/bin.c
index 9d67bec..2798ade 100644
--- a/shared/bin.c
+++ b/shared/bin.c
@@ -10,10 +10,10 @@
#define _SHIFT_1B (8 * 1)
#define _SHIFT_2B (8 * 2)
#define _SHIFT_3B (8 * 3)
-#define _BYTE_0 ((uint32_t) 0xff << (_SHIFT_0B))
-#define _BYTE_1 ((uint32_t) 0xff << (_SHIFT_1B))
-#define _BYTE_2 ((uint32_t) 0xff << (_SHIFT_2B))
-#define _BYTE_3 ((uint32_t) 0xff << (_SHIFT_3B))
+#define _BYTE_0 ((uint32_t)0xff << (_SHIFT_0B))
+#define _BYTE_1 ((uint32_t)0xff << (_SHIFT_1B))
+#define _BYTE_2 ((uint32_t)0xff << (_SHIFT_2B))
+#define _BYTE_3 ((uint32_t)0xff << (_SHIFT_3B))
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshift-count-overflow"
diff --git a/shared/consts.h b/shared/consts.h
index a083f61..9b9aeee 100644
--- a/shared/consts.h
+++ b/shared/consts.h
@@ -66,4 +66,3 @@
/** arbitrary grid constants */
#define W2_GRID_CROSSWALK_DISTANCE 400
-