From 1e02be1cbe955675ed57fa519f5923114430b6ee Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 1 Jul 2024 23:24:44 -0600 Subject: [PATCH] Format with uncrustify Signed-off-by: Tim Crawford --- src/arch/avr/uart.c | 24 ++++++++++----------- src/board/system76/common/flash/main.c | 3 ++- src/board/system76/common/kbc.c | 6 +++--- src/board/system76/common/kbled/bonw14.c | 10 ++++----- src/board/system76/common/kbled/white_dac.c | 4 ++-- src/board/system76/common/kbscan.c | 2 +- src/board/system76/common/peci.c | 5 +++-- src/board/system76/common/usbpd/tps65987.c | 2 +- src/board/system76/lemp9/board.c | 2 +- src/common/i2c.c | 6 ++++-- 10 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/arch/avr/uart.c b/src/arch/avr/uart.c index a2f8914..8b63a8f 100644 --- a/src/arch/avr/uart.c +++ b/src/arch/avr/uart.c @@ -22,20 +22,20 @@ } #if defined(__AVR_ATmega328P__) - static struct Uart UARTS[] = { - UART(0) - }; +static struct Uart UARTS[] = { + UART(0) +}; #elif defined(__AVR_ATmega32U4__) - static struct Uart UARTS[] = { - UART(1) - }; +static struct Uart UARTS[] = { + UART(1) +}; #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - static struct Uart UARTS[] = { - UART(0), - UART(1), - UART(2), - UART(3) - }; +static struct Uart UARTS[] = { + UART(0), + UART(1), + UART(2), + UART(3) +}; #else #error "Could not find UART definitions" #endif diff --git a/src/board/system76/common/flash/main.c b/src/board/system76/common/flash/main.c index 562f206..58d0d69 100644 --- a/src/board/system76/common/flash/main.c +++ b/src/board/system76/common/flash/main.c @@ -46,7 +46,8 @@ void flash_write_enable(void); * NOTE: __critical to ensure interrupts are disabled. This does mean that interrupt * such as the timer will be block until flash acccess is complete */ -void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, uint8_t command) __reentrant __critical { +void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, + uint8_t command) __reentrant __critical { // Only allow access from 64KB to 128KB. if ((addr < 0x10000) || (length > 0x10000) || ((addr + length) > 0x20000)) return; diff --git a/src/board/system76/common/kbc.c b/src/board/system76/common/kbc.c index c68e9d8..c6d43b5 100644 --- a/src/board/system76/common/kbc.c +++ b/src/board/system76/common/kbc.c @@ -120,7 +120,7 @@ bool kbc_scancode(uint16_t key, bool pressed) { case KF_E0: scancodes[scancodes_len++] = 0xE0; key &= 0xFF; - // Fall through + // Fall through case 0x00: if (!pressed) { if (kbc_translate) { @@ -258,7 +258,7 @@ static void kbc_on_input_data(struct Kbc *const kbc, uint8_t data) { case KBC_STATE_TOUCHPAD: // Interrupt touchpad command state = KBC_STATE_NORMAL; - // Fall through + // Fall through case KBC_STATE_NORMAL: TRACE(" keyboard command\n"); // Keyboard commands clear output buffer @@ -422,7 +422,7 @@ static void kbc_on_output_empty(struct Kbc *const kbc) { break; case KBC_STATE_TOUCHPAD: state_data = *(PS2_TOUCHPAD.data); - // Fall through + // Fall through case KBC_STATE_MOUSE: TRACE("kbc mouse: %02X\n", state_data); if (kbc_mouse(kbc, state_data, KBC_TIMEOUT)) { diff --git a/src/board/system76/common/kbled/bonw14.c b/src/board/system76/common/kbled/bonw14.c index b1eec9e..a881ee8 100644 --- a/src/board/system76/common/kbled/bonw14.c +++ b/src/board/system76/common/kbled/bonw14.c @@ -31,26 +31,26 @@ void kbled_reset(void) { // Keep the following functions for compatibility - they are set via USB HID uint8_t kbled_get(void) { - /* Always off */ + // Always off return 0; } uint8_t kbled_max(void) { - /* Always off */ + // Always off return 0; } void kbled_set(uint8_t level) { - /* Fix unused variable */ + // Fix unused variable level = level; } uint32_t kbled_get_color(void) { - /* Always black */ + // Always black return 0; } void kbled_set_color(uint32_t color) { - /* Fix unused variable */ + // Fix unused variable color = color; } diff --git a/src/board/system76/common/kbled/white_dac.c b/src/board/system76/common/kbled/white_dac.c index 694f3bd..62d30e6 100644 --- a/src/board/system76/common/kbled/white_dac.c +++ b/src/board/system76/common/kbled/white_dac.c @@ -35,11 +35,11 @@ void kbled_set(uint8_t level) { } uint32_t kbled_get_color(void) { - /* Always white */ + // Always white return 0xFFFFFF; } void kbled_set_color(uint32_t color) { - /* Fix unused variable */ + // Fix unused variable color = color; } diff --git a/src/board/system76/common/kbscan.c b/src/board/system76/common/kbscan.c index 938a4fa..2d783e2 100644 --- a/src/board/system76/common/kbscan.c +++ b/src/board/system76/common/kbscan.c @@ -382,7 +382,7 @@ void kbscan_event(void) { } kbscan_matrix[i] = new; - } else if (new &&repeat_key != 0 && key_should_repeat(repeat_key)) { + } else if (new && repeat_key != 0 && key_should_repeat(repeat_key)) { // A key is being pressed uint32_t time = time_get(); static uint32_t repeat_start = 0; diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index a73ab18..ca46596 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -82,7 +82,7 @@ bool peci_available(void) { // If VW_HOST_C10 virtual wire is VWS_HIGH, PECI will wake the CPU //TODO: wake CPU every 8 seconds following Intel recommendation? - return (vw_get(&VW_HOST_C10) != VWS_HIGH); + return vw_get(&VW_HOST_C10) != VWS_HIGH; #else // PECI is available if PLTRST# is high return gpio_get(&BUF_PLT_RST_N); @@ -415,7 +415,8 @@ int16_t peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) { #endif // CONFIG_PECI_OVER_ESPI -// PECI information can be found here: https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf +// PECI information can be found here: +// https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf uint8_t peci_get_fan_duty(void) { uint8_t duty; diff --git a/src/board/system76/common/usbpd/tps65987.c b/src/board/system76/common/usbpd/tps65987.c index 9b0341a..487d154 100644 --- a/src/board/system76/common/usbpd/tps65987.c +++ b/src/board/system76/common/usbpd/tps65987.c @@ -69,7 +69,7 @@ static int16_t usbpd_current_limit(void) { } static void usbpd_dump(void) { - /* Dump all registers for debugging */ + // Dump all registers for debugging for (uint8_t reg = 0x00; reg < 0x40; reg += 1) { uint8_t value[65] = { 0 }; int16_t res = i2c_get(&I2C_USBPD, USBPD_ADDRESS, reg, value, sizeof(value)); diff --git a/src/board/system76/lemp9/board.c b/src/board/system76/lemp9/board.c index 90736c6..d148109 100644 --- a/src/board/system76/lemp9/board.c +++ b/src/board/system76/lemp9/board.c @@ -19,7 +19,7 @@ void board_init(void) { } void board_on_ac(bool ac) { - /* Fix unused variable */ + // Fix unused variable ac = ac; } diff --git a/src/common/i2c.c b/src/common/i2c.c index e5fe144..40197e1 100644 --- a/src/common/i2c.c +++ b/src/common/i2c.c @@ -2,7 +2,8 @@ #include -int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant { +int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, + uint16_t length) __reentrant { int16_t res = 0; res = i2c_start(i2c, addr, true); @@ -18,7 +19,8 @@ int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint1 return res; } -int16_t i2c_send(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant { +int16_t i2c_send(struct I2C *const i2c, uint8_t addr, uint8_t *const data, + uint16_t length) __reentrant { int16_t res = 0; res = i2c_start(i2c, addr, false);