Upgrade arm-none-eabi compiler
It was 5 years out of date and didn't fully support C++20.
In doing so, flip off "freestanding" mode for the cortex-m4f compiler's
use of libstdc++.
This is because some libraries appear to have been using STL headers
that cannot be safely linked against in freestanding mode (e.g.,
<ostream>). I am unsure why the prior compiler was not catching this.
If this becomes a problem, we can disable it.
Change-Id: Ie08ce2c089f787b0433a761ad2242dcd2a516404
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/motors/peripheral/adc_dma.cc b/motors/peripheral/adc_dma.cc
index d2dc6c9..15d50eb 100644
--- a/motors/peripheral/adc_dma.cc
+++ b/motors/peripheral/adc_dma.cc
@@ -147,17 +147,16 @@
DMAMUX0.CHCFG[reconfigure_dma_channel(0)] = 0;
DMAMUX0.CHCFG[reconfigure_dma_channel(1)] = 0;
- static constexpr ssize_t kResultABOffset =
- static_cast<ssize_t>(offsetof(KINETIS_ADC_t, RB)) -
- static_cast<ssize_t>(offsetof(KINETIS_ADC_t, RA));
+ static constexpr long kResultABOffset =
+ static_cast<long>(offsetof(KINETIS_ADC_t, RB)) -
+ static_cast<long>(offsetof(KINETIS_ADC_t, RA));
static_assert(kResultABOffset > 0, "Offset is backwards");
- static constexpr ssize_t kResultOffsetBits =
- ConstexprLog2(kResultABOffset * 2);
- static constexpr ssize_t kSC1ABOffset =
- static_cast<ssize_t>(offsetof(KINETIS_ADC_t, SC1B)) -
- static_cast<ssize_t>(offsetof(KINETIS_ADC_t, SC1A));
+ static constexpr long kResultOffsetBits = ConstexprLog2(kResultABOffset * 2);
+ static constexpr long kSC1ABOffset =
+ static_cast<long>(offsetof(KINETIS_ADC_t, SC1B)) -
+ static_cast<long>(offsetof(KINETIS_ADC_t, SC1A));
static_assert(kSC1ABOffset > 0, "Offset is backwards");
- static constexpr ssize_t kSC1OffsetBits = ConstexprLog2(kSC1ABOffset * 2);
+ static constexpr long kSC1OffsetBits = ConstexprLog2(kSC1ABOffset * 2);
for (int adc = 0; adc < 2; ++adc) {
// Make sure we can actually write to all the fields in the DMA channels.
DMA.CDNE = result_dma_channel(adc);
@@ -204,16 +203,16 @@
if (next_result_channel != -1) {
link = M_TCD_ELINK | V_TCD_LINKCH(next_result_channel);
}
- result_dma(adc)->CITER = result_dma(adc)->BITER =
- link | 4 /* 4 minor iterations */;
+ result_dma(adc)->CITER = link | 4 /* 4 minor iterations */;
+ result_dma(adc)->BITER = link | 4 /* 4 minor iterations */;
}
{
uint16_t link = 0;
if (next_reconfigure_channel != -1) {
link = M_TCD_ELINK | V_TCD_LINKCH(next_reconfigure_channel);
}
- reconfigure_dma(adc)->CITER = reconfigure_dma(adc)->BITER =
- link | 4 /* 4 minor iterations */;
+ reconfigure_dma(adc)->CITER = link | 4 /* 4 minor iterations */;
+ reconfigure_dma(adc)->BITER = link | 4 /* 4 minor iterations */;
}
result_dma(adc)->DLASTSGA = -(kNumberAdcSamples * sizeof(uint16_t));
reconfigure_dma(adc)->DLASTSGA = 0;