Format with uncrustify
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
		
				
					committed by
					
						 Tim Crawford
						Tim Crawford
					
				
			
			
				
	
			
			
			
						parent
						
							d3894392d5
						
					
				
				
					commit
					1e02be1cbe
				
			| @@ -22,20 +22,20 @@ | |||||||
|     } |     } | ||||||
|  |  | ||||||
| #if defined(__AVR_ATmega328P__) | #if defined(__AVR_ATmega328P__) | ||||||
|     static struct Uart UARTS[] = { | static struct Uart UARTS[] = { | ||||||
|         UART(0) |     UART(0) | ||||||
|     }; | }; | ||||||
| #elif defined(__AVR_ATmega32U4__) | #elif defined(__AVR_ATmega32U4__) | ||||||
|     static struct Uart UARTS[] = { | static struct Uart UARTS[] = { | ||||||
|         UART(1) |     UART(1) | ||||||
|     }; | }; | ||||||
| #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) | #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) | ||||||
|     static struct Uart UARTS[] = { | static struct Uart UARTS[] = { | ||||||
|         UART(0), |     UART(0), | ||||||
|         UART(1), |     UART(1), | ||||||
|         UART(2), |     UART(2), | ||||||
|         UART(3) |     UART(3) | ||||||
|     }; | }; | ||||||
| #else | #else | ||||||
|     #error "Could not find UART definitions" |     #error "Could not find UART definitions" | ||||||
| #endif | #endif | ||||||
|   | |||||||
| @@ -46,7 +46,8 @@ void flash_write_enable(void); | |||||||
|  * NOTE: __critical to ensure interrupts are disabled. This does mean that interrupt |  * NOTE: __critical to ensure interrupts are disabled. This does mean that interrupt | ||||||
|  *          such as the timer will be block until flash acccess is complete |  *          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. |     // Only allow access from 64KB to 128KB. | ||||||
|     if ((addr < 0x10000) || (length > 0x10000) || ((addr + length) > 0x20000)) |     if ((addr < 0x10000) || (length > 0x10000) || ((addr + length) > 0x20000)) | ||||||
|         return; |         return; | ||||||
|   | |||||||
| @@ -120,7 +120,7 @@ bool kbc_scancode(uint16_t key, bool pressed) { | |||||||
|     case KF_E0: |     case KF_E0: | ||||||
|         scancodes[scancodes_len++] = 0xE0; |         scancodes[scancodes_len++] = 0xE0; | ||||||
|         key &= 0xFF; |         key &= 0xFF; | ||||||
|         // Fall through |     // Fall through | ||||||
|     case 0x00: |     case 0x00: | ||||||
|         if (!pressed) { |         if (!pressed) { | ||||||
|             if (kbc_translate) { |             if (kbc_translate) { | ||||||
| @@ -258,7 +258,7 @@ static void kbc_on_input_data(struct Kbc *const kbc, uint8_t data) { | |||||||
|     case KBC_STATE_TOUCHPAD: |     case KBC_STATE_TOUCHPAD: | ||||||
|         // Interrupt touchpad command |         // Interrupt touchpad command | ||||||
|         state = KBC_STATE_NORMAL; |         state = KBC_STATE_NORMAL; | ||||||
|         // Fall through |     // Fall through | ||||||
|     case KBC_STATE_NORMAL: |     case KBC_STATE_NORMAL: | ||||||
|         TRACE("  keyboard command\n"); |         TRACE("  keyboard command\n"); | ||||||
|         // Keyboard commands clear output buffer |         // Keyboard commands clear output buffer | ||||||
| @@ -422,7 +422,7 @@ static void kbc_on_output_empty(struct Kbc *const kbc) { | |||||||
|         break; |         break; | ||||||
|     case KBC_STATE_TOUCHPAD: |     case KBC_STATE_TOUCHPAD: | ||||||
|         state_data = *(PS2_TOUCHPAD.data); |         state_data = *(PS2_TOUCHPAD.data); | ||||||
|         // Fall through |     // Fall through | ||||||
|     case KBC_STATE_MOUSE: |     case KBC_STATE_MOUSE: | ||||||
|         TRACE("kbc mouse: %02X\n", state_data); |         TRACE("kbc mouse: %02X\n", state_data); | ||||||
|         if (kbc_mouse(kbc, state_data, KBC_TIMEOUT)) { |         if (kbc_mouse(kbc, state_data, KBC_TIMEOUT)) { | ||||||
|   | |||||||
| @@ -31,26 +31,26 @@ void kbled_reset(void) { | |||||||
|  |  | ||||||
| // Keep the following functions for compatibility - they are set via USB HID | // Keep the following functions for compatibility - they are set via USB HID | ||||||
| uint8_t kbled_get(void) { | uint8_t kbled_get(void) { | ||||||
|     /* Always off */ |     // Always off | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| uint8_t kbled_max(void) { | uint8_t kbled_max(void) { | ||||||
|     /* Always off */ |     // Always off | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| void kbled_set(uint8_t level) { | void kbled_set(uint8_t level) { | ||||||
|     /* Fix unused variable */ |     // Fix unused variable | ||||||
|     level = level; |     level = level; | ||||||
| } | } | ||||||
|  |  | ||||||
| uint32_t kbled_get_color(void) { | uint32_t kbled_get_color(void) { | ||||||
|     /* Always black */ |     // Always black | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
| void kbled_set_color(uint32_t color) { | void kbled_set_color(uint32_t color) { | ||||||
|     /* Fix unused variable */ |     // Fix unused variable | ||||||
|     color = color; |     color = color; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -35,11 +35,11 @@ void kbled_set(uint8_t level) { | |||||||
| } | } | ||||||
|  |  | ||||||
| uint32_t kbled_get_color(void) { | uint32_t kbled_get_color(void) { | ||||||
|     /* Always white */ |     // Always white | ||||||
|     return 0xFFFFFF; |     return 0xFFFFFF; | ||||||
| } | } | ||||||
|  |  | ||||||
| void kbled_set_color(uint32_t color) { | void kbled_set_color(uint32_t color) { | ||||||
|     /* Fix unused variable */ |     // Fix unused variable | ||||||
|     color = color; |     color = color; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -382,7 +382,7 @@ void kbscan_event(void) { | |||||||
|             } |             } | ||||||
|  |  | ||||||
|             kbscan_matrix[i] = new; |             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 |             // A key is being pressed | ||||||
|             uint32_t time = time_get(); |             uint32_t time = time_get(); | ||||||
|             static uint32_t repeat_start = 0; |             static uint32_t repeat_start = 0; | ||||||
|   | |||||||
| @@ -82,7 +82,7 @@ bool peci_available(void) { | |||||||
|  |  | ||||||
|     // If VW_HOST_C10 virtual wire is VWS_HIGH, PECI will wake the CPU |     // If VW_HOST_C10 virtual wire is VWS_HIGH, PECI will wake the CPU | ||||||
|     //TODO: wake CPU every 8 seconds following Intel recommendation? |     //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 | #else | ||||||
|     // PECI is available if PLTRST# is high |     // PECI is available if PLTRST# is high | ||||||
|     return gpio_get(&BUF_PLT_RST_N); |     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 | #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 peci_get_fan_duty(void) { | ||||||
|     uint8_t duty; |     uint8_t duty; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -69,7 +69,7 @@ static int16_t usbpd_current_limit(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| static void usbpd_dump(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) { |     for (uint8_t reg = 0x00; reg < 0x40; reg += 1) { | ||||||
|         uint8_t value[65] = { 0 }; |         uint8_t value[65] = { 0 }; | ||||||
|         int16_t res = i2c_get(&I2C_USBPD, USBPD_ADDRESS, reg, value, sizeof(value)); |         int16_t res = i2c_get(&I2C_USBPD, USBPD_ADDRESS, reg, value, sizeof(value)); | ||||||
|   | |||||||
| @@ -19,7 +19,7 @@ void board_init(void) { | |||||||
| } | } | ||||||
|  |  | ||||||
| void board_on_ac(bool ac) { | void board_on_ac(bool ac) { | ||||||
|     /* Fix unused variable */ |     // Fix unused variable | ||||||
|     ac = ac; |     ac = ac; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -2,7 +2,8 @@ | |||||||
|  |  | ||||||
| #include <common/i2c.h> | #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; |     int16_t res = 0; | ||||||
|  |  | ||||||
|     res = i2c_start(i2c, addr, true); |     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; |     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; |     int16_t res = 0; | ||||||
|  |  | ||||||
|     res = i2c_start(i2c, addr, false); |     res = i2c_start(i2c, addr, false); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user