Disable clang-format for sensitive blocks
Things like macro blocks should not be auto-formatted. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
		
				
					committed by
					
						 Jeremy Soller
						Jeremy Soller
					
				
			
			
				
	
			
			
			
						parent
						
							04df6ae311
						
					
				
				
					commit
					b70a09e205
				
			| @@ -16,12 +16,14 @@ struct Gpio { | ||||
|     uint8_t value; | ||||
| }; | ||||
|  | ||||
| // clang-format off | ||||
| #define GPIO(BLOCK, NUMBER) { \ | ||||
|     .pin = &PIN ## BLOCK, \ | ||||
|     .ddr = &DDR ## BLOCK, \ | ||||
|     .port = &PORT ## BLOCK, \ | ||||
|     .value = BIT(NUMBER), \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| bool gpio_get(struct Gpio * gpio); | ||||
| void gpio_set(struct Gpio * gpio, bool value); | ||||
|   | ||||
| @@ -6,6 +6,7 @@ | ||||
| #include <arch/uart.h> | ||||
| #include <board/cpu.h> | ||||
|  | ||||
| // clang-format off | ||||
| #define UART(N) \ | ||||
|     { \ | ||||
|         &UCSR ## N ## A, \ | ||||
| @@ -39,6 +40,7 @@ | ||||
| #else | ||||
|     #error "Could not find UART definitions" | ||||
| #endif | ||||
| // clang-format on | ||||
|  | ||||
| int16_t uart_count() { | ||||
|     return sizeof(UARTS)/sizeof(struct Uart); | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
| #include <arch/gpio.h> | ||||
| #include <arch/uart.h> | ||||
|  | ||||
| // clang-format off | ||||
| // Mapping of 24-pin ribbon cable to parallel pins. See schematic | ||||
| #define PINS \ | ||||
|     /* Data (KSO0 - KSO7) - bi-directional */ \ | ||||
| @@ -88,6 +89,7 @@ static struct Gpio GPIOS[24] = { | ||||
|     GPIO(A, 0), GPIO(A, 1), | ||||
| }; | ||||
| #endif // !defined(FLIP) | ||||
| // clang-format on | ||||
|  | ||||
| enum ParallelState { | ||||
|     PARALLEL_STATE_UNKNOWN, | ||||
|   | ||||
| @@ -11,6 +11,7 @@ | ||||
| #include <arch/gpio.h> | ||||
| #include <arch/uart.h> | ||||
|  | ||||
| // clang-format off | ||||
| // Mapping of 24-pin ribbon cable to parallel pins. See schematic | ||||
| #define PINS \ | ||||
|     /* Data (KSO0 - KSO7) - bi-directional */ \ | ||||
| @@ -64,7 +65,7 @@ static struct Gpio GPIOS[13] = { | ||||
|     GPIO(C, 1), | ||||
|     GPIO(C, 0), | ||||
| }; | ||||
|  | ||||
| // clang-format on | ||||
|  | ||||
| // Parallel struct definition | ||||
| // See http://efplus.com/techref/io/parallel/1284/eppmode.htm | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 6); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 7); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -39,6 +40,7 @@ struct Gpio __code USB_PWR_EN_N =   GPIO(F, 7); | ||||
| struct Gpio __code VA_EC_EN =       GPIO(J, 0); // renamed to SLP_SUS_EC# | ||||
| struct Gpio __code WLAN_EN =        GPIO(J, 2); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(B, 0); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -51,5 +52,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| #define HAVE_XLP_OUT 0 | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -37,6 +38,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(J, 7); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -47,5 +48,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code AC_V1_EC =       GPIO(J, 7); | ||||
| @@ -38,6 +39,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); // renamed to SLP_SUS# | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); // renamed to EN_3V | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code AC_V1_EC; | ||||
| @@ -48,5 +49,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -66,6 +66,7 @@ void acpi_reset(void) { | ||||
| #endif | ||||
| } | ||||
|  | ||||
| // clang-format off | ||||
| uint8_t acpi_read(uint8_t addr) { | ||||
|     uint8_t data = 0; | ||||
|  | ||||
| @@ -174,6 +175,7 @@ uint8_t acpi_read(uint8_t addr) { | ||||
|     TRACE("acpi_read %02X = %02X\n", addr, data); | ||||
|     return data; | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| void acpi_write(uint8_t addr, uint8_t data) { | ||||
|     TRACE("acpi_write %02X = %02X\n", addr, data); | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/kbled.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| static uint8_t LEVEL_I = 1; | ||||
| static const uint8_t __code LEVELS[] = { | ||||
|     48, | ||||
| @@ -23,6 +24,7 @@ static const uint32_t __code COLORS[] = { | ||||
|     0x00FFFF, | ||||
|     0xFFFF00 | ||||
| }; | ||||
| // clang-format on | ||||
|  | ||||
| void kbled_hotkey_color(void) { | ||||
|     if (COLOR_I < (ARRAY_SIZE(COLORS) - 1)) { | ||||
|   | ||||
| @@ -10,6 +10,7 @@ | ||||
|  | ||||
| #define KBLED_DACDAT xconcat(DACDAT, KBLED_DAC) | ||||
|  | ||||
| // clang-format off | ||||
| static uint8_t __code levels[] = { | ||||
|     0x00, | ||||
|     0x80, | ||||
| @@ -18,6 +19,7 @@ static uint8_t __code levels[] = { | ||||
|     0xC0, | ||||
|     0xFF | ||||
| }; | ||||
| // clang-format on | ||||
|  | ||||
| void kbled_init(void) { | ||||
|     // Enable DAC used for KBLIGHT_ADJ | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 6); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 7); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -40,6 +41,7 @@ struct Gpio __code VA_EC_EN =       GPIO(E, 3); | ||||
| struct Gpio __code VR_ON =          GPIO(H, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(H, 5); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(J, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -46,5 +47,6 @@ extern struct Gpio __code VR_ON; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| #define HAVE_XLP_OUT 0 | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| #include <common/debug.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -38,6 +39,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clange-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -48,5 +49,6 @@ extern struct Gpio __code VR_ON; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 6); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 7); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -40,6 +41,7 @@ struct Gpio __code VA_EC_EN =       GPIO(E, 3); | ||||
| struct Gpio __code VR_ON =          GPIO(H, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(H, 5); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(J, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -46,5 +47,6 @@ extern struct Gpio __code VR_ON; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| #define HAVE_XLP_OUT 0 | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| #include <common/debug.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -41,6 +42,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -49,5 +50,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -35,6 +36,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); // renamed to SLP_SUS# | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -44,5 +45,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| #include <common/debug.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -38,6 +39,7 @@ struct Gpio __code VR_ON =          GPIO(H, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -48,5 +49,6 @@ extern struct Gpio __code VR_ON; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -38,6 +39,7 @@ struct Gpio __code VR_ON =          GPIO(H, 4); | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -47,5 +48,6 @@ extern struct Gpio __code VR_ON; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -3,6 +3,7 @@ | ||||
| #include <board/gpio.h> | ||||
| #include <common/debug.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 6); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 7); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -35,6 +36,7 @@ struct Gpio __code USB_PWR_EN_N =   GPIO(F, 7); | ||||
| struct Gpio __code VA_EC_EN =       GPIO(J, 0); // renamed to EC_SLP_SUS# | ||||
| struct Gpio __code WLAN_EN =        GPIO(J, 7); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(B, 0); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init(void) { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -46,5 +47,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| #define HAVE_XLP_OUT 0 | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| #include <common/debug.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -36,6 +37,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); // renamed to EC_SLP_SUS# | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(A, 3); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -46,5 +47,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
| #include <common/debug.h> | ||||
| #include <common/macro.h> | ||||
|  | ||||
| // clang-format off | ||||
| struct Gpio __code ACIN_N =         GPIO(B, 0); | ||||
| struct Gpio __code AC_PRESENT =     GPIO(E, 1); | ||||
| struct Gpio __code ALL_SYS_PWRGD =  GPIO(C, 0); | ||||
| @@ -35,6 +36,7 @@ struct Gpio __code VA_EC_EN =       GPIO(J, 4); // renamed to EC_SLP_SUS# | ||||
| struct Gpio __code WLAN_EN =        GPIO(G, 1); | ||||
| struct Gpio __code WLAN_PWR_EN =    GPIO(H, 4); | ||||
| struct Gpio __code XLP_OUT =        GPIO(B, 4); | ||||
| // clang-format on | ||||
|  | ||||
| void gpio_init() { | ||||
|     // Enable LPC reset on GPD2 | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
| void gpio_init(void); | ||||
| void gpio_debug(void); | ||||
|  | ||||
| // clang-format off | ||||
| extern struct Gpio __code ACIN_N; | ||||
| extern struct Gpio __code AC_PRESENT; | ||||
| extern struct Gpio __code ALL_SYS_PWRGD; | ||||
| @@ -45,5 +46,6 @@ extern struct Gpio __code VA_EC_EN; | ||||
| extern struct Gpio __code WLAN_EN; | ||||
| extern struct Gpio __code WLAN_PWR_EN; | ||||
| extern struct Gpio __code XLP_OUT; | ||||
| // clang-format on | ||||
|  | ||||
| #endif // _BOARD_GPIO_H | ||||
|   | ||||
| @@ -9,6 +9,7 @@ | ||||
| #endif | ||||
|  | ||||
| // https://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html#ss10.3 | ||||
| // clang-format off | ||||
| static uint8_t __code lookup[256] = { | ||||
| 0xff, 0x43, 0x41, 0x3f, 0x3d, 0x3b, 0x3c, 0x58, 0x64, 0x44, 0x42, 0x40, 0x3e, 0x0f, 0x29, 0x59, | ||||
| 0x65, 0x38, 0x2a, 0x70, 0x1d, 0x10, 0x02, 0x5a, 0x66, 0x71, 0x2c, 0x1f, 0x1e, 0x11, 0x03, 0x5b, | ||||
| @@ -27,6 +28,7 @@ static uint8_t __code lookup[256] = { | ||||
| 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, | ||||
| 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, | ||||
| }; | ||||
| // clang-format on | ||||
|  | ||||
| uint16_t keymap_translate(uint16_t key) { | ||||
|     return (key & 0xFF00) | lookup[(key & 0xFF)]; | ||||
|   | ||||
| @@ -7,6 +7,7 @@ | ||||
|     #define __code | ||||
| #endif | ||||
|  | ||||
| // clang-format off | ||||
| static const char __code BOARD[] = | ||||
|     "76EC_BOARD=" | ||||
|     xstr(__BOARD__); | ||||
| @@ -14,6 +15,7 @@ static const char __code BOARD[] = | ||||
| static const char __code VERSION[] = | ||||
|     "76EC_VERSION=" | ||||
|     xstr(__FIRMWARE_VERSION__); | ||||
| // clang-format on | ||||
|  | ||||
| const char * board() { | ||||
|     return &BOARD[11]; | ||||
|   | ||||
| @@ -17,10 +17,12 @@ struct VirtualWire { | ||||
|     uint8_t shift; | ||||
| }; | ||||
|  | ||||
| // clang-format off | ||||
| #define VIRTUAL_WIRE(INDEX, SHIFT) { \ | ||||
|     .index = &VWIDX ## INDEX, \ | ||||
|     .shift = SHIFT, \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| enum VirtualWireState { | ||||
|     VWS_INVALID = 0x00, | ||||
|   | ||||
| @@ -21,12 +21,14 @@ struct Gpio { | ||||
|     uint8_t value; | ||||
| }; | ||||
|  | ||||
| // clang-format off | ||||
| #define GPIO(BLOCK, NUMBER) { \ | ||||
|     .data = &GPDR ## BLOCK, \ | ||||
|     .mirror = &GPDMR ## BLOCK, \ | ||||
|     .control = &GPCR ## BLOCK ## NUMBER, \ | ||||
|     .value = BIT(NUMBER), \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| bool gpio_get(struct Gpio * gpio); | ||||
| void gpio_set(struct Gpio * gpio, bool value); | ||||
|   | ||||
| @@ -2,12 +2,14 @@ | ||||
|  | ||||
| #include <ec/pmc.h> | ||||
|  | ||||
| // clang-format off | ||||
| #define PMC(NUM) { \ | ||||
|     .status = &PM ## NUM ## STS, \ | ||||
|     .data_out = &PM ## NUM ## DO, \ | ||||
|     .data_in = &PM ## NUM ## DI, \ | ||||
|     .control = &PM ## NUM ## CTL, \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| struct Pmc __code PMC_1 = PMC(1); | ||||
| struct Pmc __code PMC_2 = PMC(2); | ||||
|   | ||||
| @@ -2,12 +2,14 @@ | ||||
|  | ||||
| #include <ec/ps2.h> | ||||
|  | ||||
| // clang-format off | ||||
| #define PS2(NUM) { \ | ||||
|     .control = &PSCTL ## NUM, \ | ||||
|     .interrupt = &PSINT ## NUM, \ | ||||
|     .status = &PSSTS ## NUM, \ | ||||
|     .data = &PSDAT ## NUM, \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| struct Ps2 __code PS2_1 = PS2(1); | ||||
| struct Ps2 __code PS2_2 = PS2(2); | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
|  | ||||
| #include <ec/espi.h> | ||||
|  | ||||
| // clang-format off | ||||
| #if EC_ESPI | ||||
| // eSPI signature (byte 7 = 0xA4) | ||||
| static __code const uint8_t __at(0x40) SIGNATURE[16] = { | ||||
| @@ -15,3 +16,4 @@ static __code const uint8_t __at(0x40) SIGNATURE[16] = { | ||||
|     0x85, 0x12, 0x5A, 0x5A, 0xAA, 0x00, 0x55, 0x55, | ||||
| }; | ||||
| #endif // EC_ESPI | ||||
| // clang-format on | ||||
|   | ||||
| @@ -13,6 +13,7 @@ | ||||
| // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions | ||||
| #include <common/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| // Conversion of physical ANSI layout to keyboard matrix | ||||
| #define LAYOUT( \ | ||||
|     K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ | ||||
| @@ -68,6 +69,7 @@ | ||||
|     { ___, ___, K60, K1D, K57, K0F, ___, K0G }, \ | ||||
|     { ___, ___, K2D, ___, K61, K0C, ___, K59 } \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| // Position of physical Esc key in the matrix | ||||
| #define MATRIX_ESC_INPUT    7 | ||||
|   | ||||
| @@ -5,6 +5,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) | ||||
| LAYOUT_ISO( | ||||
| @@ -27,3 +28,4 @@ LAYOUT_ISO( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, | ||||
| @@ -24,3 +25,4 @@ LAYOUT( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -8,6 +8,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) | ||||
| LAYOUT_ISO( | ||||
| @@ -30,3 +31,4 @@ LAYOUT_ISO( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -5,6 +5,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_INSERT, K_DEL, | ||||
| @@ -25,3 +26,4 @@ LAYOUT( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, | ||||
| @@ -24,3 +25,4 @@ LAYOUT( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_HOME, K_END, K_PRINT_SCREEN, K_DEL, | ||||
| @@ -24,3 +25,4 @@ LAYOUT( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -7,6 +7,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| // TODO: K0E=K_PAUSE (once defined in src/common/include/common/keymap.h) | ||||
| LAYOUT_ISO( | ||||
| @@ -29,3 +30,4 @@ LAYOUT_ISO( | ||||
|     K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -13,6 +13,7 @@ | ||||
| // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions | ||||
| #include <common/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| // Conversion of physical layout to keyboard matrix | ||||
| #define LAYOUT( \ | ||||
|     K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ | ||||
| @@ -39,6 +40,7 @@ | ||||
|     { ___, K2D, K58, K1D, K2E, K0F, K1E, K0G }, \ | ||||
|     { K56, ___, K3C, ___, K59, K0C, K4D, K3D } \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| // Position of physical Esc key in the matrix | ||||
| #define MATRIX_ESC_INPUT    7 | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, 0 /* pause */, K_INSERT, K_DEL, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_SPACE, K_RIGHT_CTRL, K_APP, K_RIGHT_ALT, K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, 0 /* pause */, K_INSERT, K_DEL, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, 0 /* pause */, K_INSERT, K_DEL, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -21,6 +21,7 @@ | ||||
|     #define KI2 K_INT_2 | ||||
| #endif | ||||
|  | ||||
| // clang-format off | ||||
| // Conversion of physical layout to keyboard matrix | ||||
| #define LAYOUT( \ | ||||
|     K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ | ||||
| @@ -49,6 +50,7 @@ | ||||
|     { K0H, K0G, K43, K4C, K59, K10, K0B, K0C }, \ | ||||
|     { K35, K1C, K4F, K51, K4D, K58, K5A, ___ } \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| // Position of physical Esc key in the matrix | ||||
| #define MATRIX_ESC_INPUT    7 | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -15,6 +15,7 @@ | ||||
| // common/keymap.h requires KM_LAY, KM_OUT, and KM_IN definitions | ||||
| #include <common/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| // Conversion of physical layout to keyboard matrix | ||||
| #define LAYOUT( \ | ||||
|     K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J, \ | ||||
| @@ -43,6 +44,7 @@ | ||||
|     { ___, ___, ___, ___, ___, ___, ___, ___ }, /* 16 */ \ | ||||
|     { ___, ___, ___, ___, ___, ___, ___, ___ }  /* 17 */ \ | ||||
| } | ||||
| // clang-format on | ||||
|  | ||||
| // Position of physical Esc key in the matrix | ||||
| #define MATRIX_ESC_INPUT    0 | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| #include <board/keymap.h> | ||||
|  | ||||
| // clang-format off | ||||
| uint16_t __code KEYMAP[KM_LAY][KM_OUT][KM_IN] = { | ||||
| LAYOUT( | ||||
|     K_ESC, K_F1, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_F10, K_F11, K_F12, K_PRINT_SCREEN, K_INSERT, K_DEL, K_HOME, K_END, K_PGUP, K_PGDN, | ||||
| @@ -22,3 +23,4 @@ LAYOUT( | ||||
|     K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, KT_FN, K_RIGHT_ALT, K_RIGHT_CTRL, K_LEFT, K_DOWN, K_RIGHT, K_NUM_0, K_NUM_PERIOD | ||||
| ) | ||||
| }; | ||||
| // clang-format on | ||||
|   | ||||
		Reference in New Issue
	
	Block a user