diff --git a/.clang-format b/.clang-format index dd0c445..3bf4132 100644 --- a/.clang-format +++ b/.clang-format @@ -17,7 +17,7 @@ AlwaysBreakAfterReturnType: None AlwaysBreakTemplateDeclarations: Yes BreakBeforeBraces: Custom BraceWrapping: - AfterCaseLabel: false + AfterCaseLabel: true AfterClass: true AfterControlStatement: Always AfterEnum: true @@ -25,8 +25,8 @@ BraceWrapping: AfterNamespace: true AfterUnion: true AfterStruct: true - BeforeCatch: false - BeforeElse: false + BeforeCatch: true + BeforeElse: true IndentBraces: false SplitEmptyFunction: false SplitEmptyRecord: true diff --git a/Peripherals/Inc/peripherals_motors.hpp b/Peripherals/Inc/peripherals_motors.hpp index 8de9c18..b5e2cc2 100644 --- a/Peripherals/Inc/peripherals_motors.hpp +++ b/Peripherals/Inc/peripherals_motors.hpp @@ -54,7 +54,8 @@ public: { left_.forward.setCompare(left); left_.backward.setCompare(0); - } else + } + else { left_.forward.setCompare(0); left_.backward.setCompare(-1 * left); @@ -64,7 +65,8 @@ public: { right_.forward.setCompare(right); right_.backward.setCompare(0); - } else + } + else { right_.forward.setCompare(0); right_.backward.setCompare(-1 * right); diff --git a/Threads/Inc/threads_exclusivesignal.hpp b/Threads/Inc/threads_exclusivesignal.hpp index c7c0726..faa805a 100644 --- a/Threads/Inc/threads_exclusivesignal.hpp +++ b/Threads/Inc/threads_exclusivesignal.hpp @@ -65,7 +65,8 @@ public: if (!notified) { return std::nullopt; - } else + } + else { return current_value_; } @@ -78,7 +79,8 @@ public: if (!waiting_thread_) { return false; - } else + } + else { return waiting_thread_->notify(0, eNoAction); } @@ -91,7 +93,8 @@ public: if (!waiting_thread_) { return {false, pdFALSE}; - } else + } + else { auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction); (void) discard; @@ -158,7 +161,8 @@ struct ExclusiveSignal : public Signallable if (!waiting_thread_) { return pdFALSE; - } else + } + else { auto const [discard, was_notified] = waiting_thread_->notifyFromIsr(0, eNoAction); (void) discard; diff --git a/Utility/Inc/utility_pixelbuffer.hpp b/Utility/Inc/utility_pixelbuffer.hpp index b03b523..da04323 100644 --- a/Utility/Inc/utility_pixelbuffer.hpp +++ b/Utility/Inc/utility_pixelbuffer.hpp @@ -158,15 +158,18 @@ public: if (dx == 0 && dy == 0) { at(start) = color; - } else if (dx == 0) + } + else if (dx == 0) { for (; y < y_(stop); y++) at({x, y}) = color; - } else if (dy == 0) + } + else if (dy == 0) { for (; x < x_(stop); x++) at({x, y}) = color; - } else + } + else { // Bresenham's algorithm. std::int32_t p = 2 * dy - dx; @@ -179,7 +182,8 @@ public: { y++; p = p + 2 * dy - 2 * dx; - } else + } + else { p = p + 2 * dy; } @@ -217,7 +221,8 @@ public: { y--; d = d + 4 * (x - y) + 10; - } else + } + else { d = d + 4 * x + 6; } diff --git a/Utility/Inc/utility_ringbuffer.hpp b/Utility/Inc/utility_ringbuffer.hpp index 506ccf7..9f508a9 100644 --- a/Utility/Inc/utility_ringbuffer.hpp +++ b/Utility/Inc/utility_ringbuffer.hpp @@ -68,7 +68,8 @@ public: if (naive < _arr_end) { return iterator(naive, _arr_begin, _arr_end); - } else + } + else { const pointer remainder = pointer(naive - _arr_end); return iterator(_arr_begin + difference_type(remainder), _arr_begin, @@ -82,7 +83,8 @@ public: if (naive >= _arr_begin) { return iterator(naive, _arr_begin, _arr_end); - } else + } + else { const pointer remainder = pointer(_arr_begin - naive); return iterator(_arr_end - difference_type(remainder), _arr_begin, @@ -202,7 +204,8 @@ public: if (distance > 0) { return distance; - } else + } + else { return head_ - tail_ + 1; }