Replace clang-format with uncrustify

LLVM/clang is not used for any compilation due to it not supporting the
8-bit architectures we use (MCS-51, AVR). This means we are effectively
installing 250+ MiB of dependencies for a C formatting tool.

Replace it with uncrustify, which uses only ~600 KiB of space and has
more granular control of formatting (800+ options).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2024-07-01 16:49:03 -06:00
committed by Tim Crawford
parent 6c3b34ee6e
commit d3894392d5
125 changed files with 392 additions and 484 deletions

View File

@@ -44,12 +44,10 @@ uint8_t fan_duty(const struct Fan *const fan, int16_t temp) __reentrant {
if (temp > prev->temp) {
int16_t dtemp = (cur->temp - prev->temp);
int16_t dduty = ((int16_t)cur->duty) - ((int16_t)prev->duty);
// clang-format off
return (uint8_t)(
((int16_t)prev->duty) +
((temp - prev->temp) * dduty) / dtemp
);
// clang-format on
}
} else {
return prev->duty;
@@ -127,11 +125,9 @@ uint8_t fan_smooth(uint8_t last_duty, uint8_t duty) __reentrant {
// ramping down
if (duty < last_duty) {
// out of bounds (lower) safeguard
// clang-format off
uint8_t smoothed = last_duty < MIN_FAN_SPEED + MAX_JUMP_DOWN
? MIN_FAN_SPEED
: last_duty - MAX_JUMP_DOWN;
// clang-format on
// use smoothed value if above min and if smoothed is closer than raw
if (last_duty > MIN_SPEED_TO_SMOOTH && smoothed > duty) {
@@ -142,11 +138,9 @@ uint8_t fan_smooth(uint8_t last_duty, uint8_t duty) __reentrant {
// ramping up
if (duty > last_duty) {
// out of bounds (higher) safeguard
// clang-format off
uint8_t smoothed = last_duty > MAX_FAN_SPEED - MAX_JUMP_UP
? MAX_FAN_SPEED
: last_duty + MAX_JUMP_UP;
// clang-format on
// use smoothed value if above min and if smoothed is closer than raw
if (duty > MIN_SPEED_TO_SMOOTH && smoothed < duty) {