diff --git a/.clang-format b/.clang-format index 34505001067462a9df063d5834a7f9ee8192488c..827c89b435020ccdca9a15eb06a972ac5947c742 100644 --- a/.clang-format +++ b/.clang-format @@ -5,6 +5,7 @@ AllowShortIfStatementsOnASingleLine: false, AllowShortLoopsOnASingleLine: false, BreakBeforeBraces: Allman, + ColumnLimit: 80, ConstructorInitializerAllOnOneLineOrOnePerLine: false, IndentCaseLabels: true, IndentWidth: 4, diff --git a/src/shared/drivers/ethernet/WatchdogTimer.cpp b/src/shared/drivers/ethernet/WatchdogTimer.cpp index 9e698b7b98af26d97c45717087a6b49a96af4869..2074be2ec5123d7e67cb74c5bbb66e907f252741 100644 --- a/src/shared/drivers/ethernet/WatchdogTimer.cpp +++ b/src/shared/drivers/ethernet/WatchdogTimer.cpp @@ -118,5 +118,5 @@ void WatchdogTimer::setDuration(uint16_t duration) { float ticks = static_cast<float>(duration) * ms_to_tick; - TIM7->ARR = static_cast<uint16_t>(ticks + 0.5f); // round to nearest + TIM7->ARR = static_cast<uint16_t>(ticks + 0.5f); // round to nearest } diff --git a/src/shared/i2c/stm32f2_f4_i2c.cpp b/src/shared/i2c/stm32f2_f4_i2c.cpp index f2cf31b60767cc31012644863d10672a4914968c..331d630aecb9ecf7b48df49911c67d4b2fe132f2 100644 --- a/src/shared/i2c/stm32f2_f4_i2c.cpp +++ b/src/shared/i2c/stm32f2_f4_i2c.cpp @@ -90,12 +90,12 @@ void DMA1_Stream7_IRQHandler() // We can't just wake the thread because the I2C is double buffered, and // this interrupt is fired at the same time as the second last byte is - // starting to be sent out of the bus. If we return now, the main code would - // send a stop condiotion too soon, and the last byte would never be sent. - // Instead, we change from DMA mode to IRQ mode, so when the second last byte - // is sent, that interrupt is fired and the last byte is sent out. Note that - // since no thread is awakened from this IRQ, there's no need for the - // saveContext(), restoreContext() and __attribute__((naked)) + // starting to be sent out of the bus. If we return now, the main code + // would send a stop condiotion too soon, and the last byte would never be + // sent. Instead, we change from DMA mode to IRQ mode, so when the second + // last byte is sent, that interrupt is fired and the last byte is sent + // out. Note that since no thread is awakened from this IRQ, there's no + // need for the saveContext(), restoreContext() and __attribute__((naked)) I2C1->CR2 &= ~I2C_CR2_DMAEN; I2C1->CR2 |= I2C_CR2_ITBUFEN | I2C_CR2_ITEVTEN; }