Format with uncrustify

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2024-07-01 23:24:44 -06:00
committed by Tim Crawford
parent d3894392d5
commit 1e02be1cbe
10 changed files with 34 additions and 30 deletions

View File

@ -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

View File

@ -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;

View File

@ -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)) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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));

View File

@ -19,7 +19,7 @@ void board_init(void) {
}
void board_on_ac(bool ac) {
/* Fix unused variable */
// Fix unused variable
ac = ac;
}

View File

@ -2,7 +2,8 @@
#include <common/i2c.h>
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);