Switch to a new cortex-m4 compiler
This one is newer, so it supports a newer C++ standard. It's also
hermetic.
Also add a variant for building for some Kinetis-K chips with less RAM
that are used on fet12v2.
Change-Id: I9e50b6aae498e0c35acfedb846b3ada619a0e630
diff --git a/motors/pistol_grip/controller.cc b/motors/pistol_grip/controller.cc
index 8b842b7..2bb3e01 100644
--- a/motors/pistol_grip/controller.cc
+++ b/motors/pistol_grip/controller.cc
@@ -359,20 +359,20 @@
static_cast<int32_t>(static_cast<uint32_t>(data[0]) |
(static_cast<uint32_t>(data[1]) << 8)) -
32768) /
- 32768.0f * M_PI / 8.0;
+ static_cast<float>(32768.0 * M_PI / 8.0);
trigger_goal_velocity =
static_cast<float>(
static_cast<int32_t>(static_cast<uint32_t>(data[2]) |
(static_cast<uint32_t>(data[3]) << 8)) -
32768) /
- 32768.0f * 4.0f;
+ static_cast<float>(32768.0 * 4.0);
trigger_haptic_current =
static_cast<float>(
static_cast<int32_t>(static_cast<uint32_t>(data[4]) |
(static_cast<uint32_t>(data[5]) << 8)) -
32768) /
- 32768.0f * 2.0f;
+ static_cast<float>(32768.0 * 2.0);
if (trigger_haptic_current > kHapticTriggerCurrentLimit) {
trigger_haptic_current = kHapticTriggerCurrentLimit;
} else if (trigger_haptic_current < -kHapticTriggerCurrentLimit) {
@@ -400,20 +400,20 @@
static_cast<int32_t>(static_cast<uint32_t>(data[0]) |
(static_cast<uint32_t>(data[1]) << 8)) -
32768) /
- 32768.0f * M_PI;
+ static_cast<float>(32768.0 * M_PI);
wheel_goal_velocity =
static_cast<float>(
static_cast<int32_t>(static_cast<uint32_t>(data[2]) |
(static_cast<uint32_t>(data[3]) << 8)) -
32768) /
- 32768.0f * 10.0f;
+ static_cast<float>(32768.0 * 10.0);
wheel_haptic_current =
static_cast<float>(
static_cast<int32_t>(static_cast<uint32_t>(data[4]) |
(static_cast<uint32_t>(data[5]) << 8)) -
32768) /
- 32768.0f * 2.0f;
+ static_cast<float>(32768.0 * 2.0);
if (wheel_haptic_current > kHapticWheelCurrentLimit) {
wheel_haptic_current = kHapticWheelCurrentLimit;
} else if (wheel_haptic_current < -kHapticWheelCurrentLimit) {