Run clang-format on the entire repo
This patch clang-formats the entire repo. Third-party code is
excluded.
I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/motors/big/medium_salsa.cc b/motors/big/medium_salsa.cc
index 6c3f339..ab0f3d6 100644
--- a/motors/big/medium_salsa.cc
+++ b/motors/big/medium_salsa.cc
@@ -1,10 +1,9 @@
-#include "motors/core/kinetis.h"
-
#include <stdio.h>
#include <atomic>
#include "motors/big/motor_controls.h"
+#include "motors/core/kinetis.h"
#include "motors/core/time.h"
#include "motors/motor.h"
#include "motors/peripheral/adc.h"
@@ -133,9 +132,10 @@
}
const BalancedReadings balanced = BalanceReadings(to_balance);
- global_motor.load(::std::memory_order_relaxed)->CurrentInterrupt(
- balanced,
- global_motor.load(::std::memory_order_relaxed)->wrapped_encoder());
+ global_motor.load(::std::memory_order_relaxed)
+ ->CurrentInterrupt(
+ balanced,
+ global_motor.load(::std::memory_order_relaxed)->wrapped_encoder());
}
} // extern "C"
@@ -210,8 +210,8 @@
// value we store because writing anything resets it to CNTIN (ie 0).
"str %[scratch], [%[cnt]]\n"
: [scratch] "=&l"(scratch)
- : [pdir_word] "l"(&PERIPHERAL_BITBAND(GPIOE_PDIR, 24)),
- [cnt] "l"(&FTM1->CNT));
+ : [pdir_word] "l"(&PERIPHERAL_BITBAND(GPIOE_PDIR, 24)), [cnt] "l"(
+ &FTM1->CNT));
__enable_irq();
#endif
}
@@ -290,7 +290,7 @@
FTM0_EXTTRIG = FTM_EXTTRIG_INITTRIGEN;
// Don't let any memory accesses sneak past here, because we actually
// need everything to be starting up.
- __asm__("" :: : "memory");
+ __asm__("" ::: "memory");
// Give everything a chance to get going.
delay(100);
diff --git a/motors/big/motor_controls.cc b/motors/big/motor_controls.cc
index abc71e8..db9878d 100644
--- a/motors/big/motor_controls.cc
+++ b/motors/big/motor_controls.cc
@@ -166,7 +166,8 @@
const ::Eigen::Matrix<float, 3, 1> measured_current =
(::Eigen::Matrix<float, 3, 1>() << scale_current_reading(raw_currents[0]),
scale_current_reading(raw_currents[1]),
- scale_current_reading(raw_currents[2])).finished();
+ scale_current_reading(raw_currents[2]))
+ .finished();
const ComplexMatrix<3, 1> E1 =
E1Unrotated_ *
diff --git a/motors/big/motor_controls.h b/motors/big/motor_controls.h
index 5c59ef1..8aae5d1 100644
--- a/motors/big/motor_controls.h
+++ b/motors/big/motor_controls.h
@@ -4,11 +4,11 @@
#include <array>
#include <complex>
+#include "Eigen/Dense"
+
#include "motors/math.h"
#include "motors/motor.h"
-#include "Eigen/Dense"
-
namespace frc971 {
namespace motors {
@@ -40,8 +40,8 @@
}
::std::array<float, 3> DoIteration(const float raw_currents[3],
- uint32_t theta,
- const float command_current) override;
+ uint32_t theta,
+ const float command_current) override;
int16_t Debug(uint32_t theta) override;