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:
committed by
Tim Crawford
parent
6c3b34ee6e
commit
d3894392d5
@@ -8,7 +8,7 @@
|
||||
#define OSC_DIVISOR 12
|
||||
#define TICK_INTERVAL_MS 1
|
||||
// Value to reload into the timer when the overflow interrupt is triggered.
|
||||
#define TIMER_RELOAD (0xFFFF - ((TICK_INTERVAL_MS) * ((CONFIG_CLOCK_FREQ_KHZ) / OSC_DIVISOR)))
|
||||
#define TIMER_RELOAD (0xFFFF - (TICK_INTERVAL_MS * (CONFIG_CLOCK_FREQ_KHZ / OSC_DIVISOR)))
|
||||
|
||||
static volatile uint32_t time_overflows = 0;
|
||||
|
||||
|
@@ -11,9 +11,11 @@
|
||||
#include <arch/i2c_slave.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// uncrustify:off
|
||||
static void (*volatile i2c_slave_new_cb)() = NULL;
|
||||
static void (*volatile i2c_slave_recv_cb)(uint8_t) = NULL;
|
||||
static uint8_t (*volatile i2c_slave_send_cb)() = NULL;
|
||||
// uncrustify:on
|
||||
|
||||
void i2c_slave_init(
|
||||
uint8_t address,
|
||||
|
@@ -16,14 +16,12 @@ 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(const struct Gpio *const gpio);
|
||||
void gpio_set(struct Gpio *const gpio, bool value);
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include <arch/uart.h>
|
||||
#include <board/cpu.h>
|
||||
|
||||
// clang-format off
|
||||
#define UART(N) \
|
||||
{ \
|
||||
&UCSR ## N ## A, \
|
||||
@@ -40,7 +39,6 @@
|
||||
#else
|
||||
#error "Could not find UART definitions"
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
int16_t uart_count(void) {
|
||||
return sizeof(UARTS) / sizeof(struct Uart);
|
||||
|
@@ -11,7 +11,6 @@
|
||||
#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 */ \
|
||||
@@ -114,8 +113,6 @@ static struct Parallel PORT = {
|
||||
.state = PARALLEL_STATE_UNKNOWN,
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
// Set port to all high-impedance inputs
|
||||
void parallel_hiz(struct Parallel *const port) {
|
||||
#define PIN(N, P) \
|
||||
@@ -137,8 +134,10 @@ void parallel_data_dir(struct Parallel *const port, bool dir) {
|
||||
void parallel_data_set_high(struct Parallel *const port, uint8_t byte) {
|
||||
// By convention all lines are high, so only set the ones needed
|
||||
#define DATA_BIT(B) \
|
||||
if (!(byte & (1 << B))) \
|
||||
gpio_set(port->d##B, true);
|
||||
if (!(byte & (1 << B))) { \
|
||||
gpio_set(port->d##B, true); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
}
|
||||
@@ -205,8 +204,10 @@ void parallel_state(struct Parallel *const port, enum ParallelState state) {
|
||||
uint8_t parallel_read_data(struct Parallel *const port) {
|
||||
uint8_t byte = 0;
|
||||
#define DATA_BIT(B) \
|
||||
if (gpio_get(port->d##B)) \
|
||||
byte |= (1 << B);
|
||||
if (gpio_get(port->d##B)) { \
|
||||
byte |= (1 << B); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
return byte;
|
||||
@@ -216,8 +217,10 @@ void parallel_write_data(struct Parallel *const port, uint8_t byte) {
|
||||
// By convention all lines are high, so only set the ones needed
|
||||
|
||||
#define DATA_BIT(B) \
|
||||
if (!(byte & (1 << B))) \
|
||||
gpio_set(port->d##B, false);
|
||||
if (!(byte & (1 << B))) { \
|
||||
gpio_set(port->d##B, false); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
}
|
||||
|
@@ -11,8 +11,6 @@
|
||||
#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 */ \
|
||||
@@ -67,8 +65,6 @@ static struct Gpio GPIOS[13] = {
|
||||
GPIO(C, 0),
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
// Parallel struct definition
|
||||
// See http://efplus.com/techref/io/parallel/1284/eppmode.htm
|
||||
struct Parallel {
|
||||
@@ -89,6 +85,7 @@ void parallel_hiz(struct Parallel *const port) {
|
||||
#define PIN(N, P) \
|
||||
gpio_set_dir(port->N, false); \
|
||||
gpio_set(port->N, false);
|
||||
|
||||
PINS
|
||||
#undef PIN
|
||||
}
|
||||
@@ -105,8 +102,10 @@ void parallel_data_dir(struct Parallel *const port, bool dir) {
|
||||
void parallel_data_set_high(struct Parallel *const port, uint8_t byte) {
|
||||
// By convention all lines are high, so only set the ones needed
|
||||
#define DATA_BIT(B) \
|
||||
if (!(byte & (1 << B))) \
|
||||
gpio_set(port->d##B, true);
|
||||
if (!(byte & (1 << B))) { \
|
||||
gpio_set(port->d##B, true); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
}
|
||||
@@ -154,8 +153,10 @@ void parallel_reset(struct Parallel *const port, bool host) {
|
||||
uint8_t parallel_read_data(struct Parallel *const port) {
|
||||
uint8_t byte = 0;
|
||||
#define DATA_BIT(B) \
|
||||
if (gpio_get(port->d##B)) \
|
||||
byte |= (1 << B);
|
||||
if (gpio_get(port->d##B)) { \
|
||||
byte |= (1 << B); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
return byte;
|
||||
@@ -164,8 +165,10 @@ uint8_t parallel_read_data(struct Parallel *const port) {
|
||||
void parallel_write_data(struct Parallel *const port, uint8_t byte) {
|
||||
// By convention all lines are high, so only set the ones needed
|
||||
#define DATA_BIT(B) \
|
||||
if (!(byte & (1 << B))) \
|
||||
gpio_set(port->d##B, false);
|
||||
if (!(byte & (1 << B))) { \
|
||||
gpio_set(port->d##B, false); \
|
||||
}
|
||||
|
||||
DATA_BITS
|
||||
#undef DATA_BIT
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -42,7 +42,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -53,6 +52,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -40,7 +40,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -50,6 +49,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -32,7 +32,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(D, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -32,7 +32,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(H, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -39,7 +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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code AC_V1_EC;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -34,7 +34,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(B, 5);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -43,6 +42,5 @@ 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
|
||||
|
@@ -43,22 +43,22 @@ void fcommand(void) {
|
||||
break;
|
||||
// Set color
|
||||
case 3:
|
||||
// clang-format off
|
||||
kbled_set_color(
|
||||
((uint32_t)fbuf[0]) |
|
||||
((uint32_t)fbuf[1] << 16) |
|
||||
((uint32_t)fbuf[2] << 8)
|
||||
);
|
||||
// clang-format on
|
||||
break;
|
||||
// Get color
|
||||
case 4:
|
||||
// uncrustify:off
|
||||
{
|
||||
uint32_t color = kbled_get_color();
|
||||
fbuf[0] = color & 0xFF;
|
||||
fbuf[1] = (color >> 16) & 0xFF;
|
||||
fbuf[2] = (color >> 8) & 0xFF;
|
||||
}
|
||||
// uncrustify:on
|
||||
break;
|
||||
// DUPLICATE: Set brightness
|
||||
case 6:
|
||||
@@ -83,7 +83,7 @@ void acpi_reset(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
uint8_t acpi_read(uint8_t addr) {
|
||||
uint8_t data = 0;
|
||||
|
||||
@@ -181,20 +181,20 @@ uint8_t acpi_read(uint8_t addr) {
|
||||
#endif // HAVE_LED_AIRPLANE_N
|
||||
|
||||
// Set size of flash (from old firmware)
|
||||
ACPI_8 (0xE5, 0x80);
|
||||
ACPI_8(0xE5, 0x80);
|
||||
|
||||
ACPI_8 (0xF8, fcmd);
|
||||
ACPI_8 (0xF9, fdat);
|
||||
ACPI_8 (0xFA, fbuf[0]);
|
||||
ACPI_8 (0xFB, fbuf[1]);
|
||||
ACPI_8 (0xFC, fbuf[2]);
|
||||
ACPI_8 (0xFD, fbuf[3]);
|
||||
ACPI_8(0xF8, fcmd);
|
||||
ACPI_8(0xF9, fdat);
|
||||
ACPI_8(0xFA, fbuf[0]);
|
||||
ACPI_8(0xFB, fbuf[1]);
|
||||
ACPI_8(0xFC, fbuf[2]);
|
||||
ACPI_8(0xFD, fbuf[3]);
|
||||
}
|
||||
|
||||
TRACE("acpi_read %02X = %02X\n", addr, data);
|
||||
return data;
|
||||
}
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void acpi_write(uint8_t addr, uint8_t data) {
|
||||
TRACE("acpi_write %02X = %02X\n", addr, data);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <common/macro.h>
|
||||
#include <common/debug.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
|
||||
// Registers
|
||||
#define REG_CHARGE_CURRENT 0x14
|
||||
@@ -86,7 +86,7 @@
|
||||
#error Invalid adapter:battery RSENSE ratio
|
||||
#endif
|
||||
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
// XXX: Assumption: ac_last is initialized high.
|
||||
static bool charger_enabled = false;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#include <common/debug.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
|
||||
// Registers
|
||||
#define REG_CHARGE_CURRENT 0x14
|
||||
@@ -71,7 +71,8 @@
|
||||
#else
|
||||
#error Invalid CHARGER_PSYS_GAIN value
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
// uncrustify:on
|
||||
|
||||
// Sense resistor values in milliohms.
|
||||
enum sense_resistor {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#define DEBUG_SET(REG, MASK, BITS) \
|
||||
{ \
|
||||
DEBUG("%s: %X", #REG, REG); \
|
||||
REG = ((REG) & ~(MASK)) | (BITS); \
|
||||
REG = (REG & ~(MASK)) | (BITS); \
|
||||
DEBUG(" set to %X\n", REG); \
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -15,7 +15,6 @@ volatile uint8_t __xdata __at(0x103D) ECINDAR2;
|
||||
volatile uint8_t __xdata __at(0x103E) ECINDAR3;
|
||||
volatile uint8_t __xdata __at(0x103F) ECINDDR;
|
||||
|
||||
// clang-format off
|
||||
#define SPI_DEVICE (0x70)
|
||||
#define SPI_FOLLOW_MODE (0x0F)
|
||||
#define SPI_CHIP_SELECT (0xFD)
|
||||
@@ -30,7 +29,6 @@ volatile uint8_t __xdata __at(0x103F) ECINDDR;
|
||||
#define SPI_ERASE_SECTOR_COMMAND (0xD7)
|
||||
|
||||
#define SPI_STATUS_WIP (0x01)
|
||||
// clang-format on
|
||||
|
||||
void flash_enter_follow_mode(void);
|
||||
void flash_exit_follow_mode(void);
|
||||
@@ -48,9 +46,7 @@ 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
|
||||
*/
|
||||
// clang-format off
|
||||
void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, uint8_t command) __reentrant __critical {
|
||||
// clang-format on
|
||||
// Only allow access from 64KB to 128KB.
|
||||
if ((addr < 0x10000) || (length > 0x10000) || ((addr + length) > 0x20000))
|
||||
return;
|
||||
@@ -73,7 +69,8 @@ void flash_entry(uint32_t addr, uint8_t *data, uint32_t length, uint8_t command)
|
||||
flash_enter_follow_mode();
|
||||
|
||||
while (length) {
|
||||
// Note, this is the slow way to do it, but it's simple and all bytes are written properly.
|
||||
// Note, this is the slow way to do it, but it's simple and all
|
||||
// bytes are written properly.
|
||||
flash_write_enable();
|
||||
|
||||
// Select the device
|
||||
|
@@ -12,11 +12,9 @@
|
||||
/** \cond INTERNAL
|
||||
* Internal defines
|
||||
*/
|
||||
// clang-format off
|
||||
#define FLASH_COMMAND_READ (0x0)
|
||||
#define FLASH_COMMAND_WRITE (0x1)
|
||||
#define FLASH_COMMAND_ERASE_1K (0x2)
|
||||
// clang-format on
|
||||
/** \endcond */
|
||||
|
||||
/**
|
||||
|
@@ -41,7 +41,6 @@ static bool kbc_translate = true;
|
||||
// LED state
|
||||
uint8_t kbc_leds = 0;
|
||||
|
||||
// clang-format off
|
||||
// Values from linux/drivers/input/keyboard/atkbd.c
|
||||
static const uint16_t kbc_typematic_period[32] = {
|
||||
33, // 30.0 cps = ~33.33ms
|
||||
@@ -77,7 +76,6 @@ static const uint16_t kbc_typematic_period[32] = {
|
||||
470, // 2.1 cps = ~478.19ms
|
||||
500, // 2.0 cps = 500ms
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static uint8_t kbc_buffer[16] = { 0 };
|
||||
static uint8_t kbc_buffer_head = 0;
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
enum KbledKind kbled_kind = KBLED_NONE;
|
||||
|
||||
// clang-format off
|
||||
static uint8_t LEVEL_I = 1;
|
||||
#ifdef KBLED_DAC
|
||||
// XXX: DAC uses separate levels due to brightness being different.
|
||||
@@ -38,7 +37,6 @@ static const uint32_t __code COLORS[] = {
|
||||
0x00FFFF,
|
||||
0xFFFF00
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void kbled_hotkey_color(void) {
|
||||
if (COLOR_I < (ARRAY_SIZE(COLORS) - 1)) {
|
||||
|
@@ -330,10 +330,8 @@ void kbscan_event(void) {
|
||||
|
||||
// A key was pressed or released
|
||||
for (uint8_t j = 0; j < KM_IN; j++) {
|
||||
// clang-format off
|
||||
bool new_b = new & BIT(j);
|
||||
bool last_b = last & BIT(j);
|
||||
// clang-format on
|
||||
if (new_b != last_b) {
|
||||
bool reset = false;
|
||||
|
||||
|
@@ -19,14 +19,12 @@
|
||||
* nWAIT = KSOH[1]
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
#define CTL_WRITE BIT(0)
|
||||
#define CTL_DATA BIT(1)
|
||||
#define CTL_RESET BIT(2)
|
||||
#define CTL_ADDR BIT(3)
|
||||
|
||||
#define STS_WAIT BIT(1)
|
||||
// clang-format on
|
||||
|
||||
// Maximum peripheral response time in ms
|
||||
#define PARALLEL_TIMEOUT 10
|
||||
|
@@ -36,9 +36,7 @@ int16_t peci_temp = 0;
|
||||
// Maximum OOB channel response time in ms
|
||||
#define PECI_ESPI_TIMEOUT 10
|
||||
|
||||
// clang-format off
|
||||
#define FAN_POINT(T, D) { .temp = PECI_TEMP(T), .duty = PWM_DUTY(D) }
|
||||
// clang-format on
|
||||
|
||||
// Fan curve with temperature in degrees C, duty cycle in percent
|
||||
static struct FanPoint __code FAN_POINTS[] = {
|
||||
|
@@ -491,7 +491,6 @@ void power_event(void) {
|
||||
}
|
||||
pg_last = pg_new;
|
||||
|
||||
// clang-format off
|
||||
static bool rst_last = false;
|
||||
bool rst_new = gpio_get(&BUF_PLT_RST_N);
|
||||
#if LEVEL >= LEVEL_DEBUG
|
||||
@@ -508,7 +507,6 @@ void power_event(void) {
|
||||
#endif // CONFIG_BUS_ESPI
|
||||
}
|
||||
rst_last = rst_new;
|
||||
// clang-format on
|
||||
|
||||
#if HAVE_SLP_SUS_N
|
||||
#if LEVEL >= LEVEL_DEBUG
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
struct Gpio __code ACIN_N = GPIO(B, 0);
|
||||
struct Gpio __code AC_PRESENT = GPIO(F, 7);
|
||||
struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0);
|
||||
@@ -31,7 +31,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(E, 1);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
struct Gpio __code ACIN_N = GPIO(B, 0);
|
||||
struct Gpio __code AC_PRESENT = GPIO(F, 7);
|
||||
struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0);
|
||||
@@ -31,7 +31,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(E, 1);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -43,7 +43,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -40,7 +40,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -50,6 +49,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_EN = GPIO(F, 3);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(G, 1);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -46,6 +45,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +37,7 @@ struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_EN = GPIO(F, 3);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(G, 1);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -47,6 +46,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -42,7 +42,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -47,6 +46,5 @@ 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
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +41,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -50,6 +49,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -39,7 +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);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -49,6 +48,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +38,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -46,6 +45,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +36,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +37,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +36,7 @@ struct Gpio __code VA_EC_EN = GPIO(H, 7);
|
||||
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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +36,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(D, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -33,7 +33,7 @@ struct Gpio __code VA_EC_EN = GPIO(H, 7);
|
||||
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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Not documented
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -39,7 +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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -49,6 +48,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +36,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Not documented
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -46,6 +45,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +37,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
struct Gpio __code ACIN_N = GPIO(B, 0);
|
||||
struct Gpio __code AC_PRESENT = GPIO(A, 4);
|
||||
struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0);
|
||||
@@ -28,7 +28,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(A, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -44,6 +43,5 @@ extern struct Gpio __code VA_EC_EN;
|
||||
#define HAVE_WLAN_EN 0
|
||||
extern struct Gpio __code WLAN_PWR_EN;
|
||||
extern struct Gpio __code XLP_OUT;
|
||||
// clang-format on
|
||||
|
||||
#endif // _BOARD_GPIO_H
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify:off
|
||||
struct Gpio __code ACIN_N = GPIO(B, 0);
|
||||
struct Gpio __code AC_PRESENT = GPIO(A, 4);
|
||||
struct Gpio __code ALL_SYS_PWRGD = GPIO(C, 0);
|
||||
@@ -28,7 +28,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(A, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -44,6 +43,5 @@ extern struct Gpio __code VA_EC_EN;
|
||||
#define HAVE_WLAN_EN 0
|
||||
extern struct Gpio __code WLAN_PWR_EN;
|
||||
extern struct Gpio __code XLP_OUT;
|
||||
// clang-format on
|
||||
|
||||
#endif // _BOARD_GPIO_H
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -40,7 +40,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -34,7 +34,7 @@ struct Gpio __code SLP_SUS_N = GPIO(H, 7);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(D, 3);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +35,7 @@ struct Gpio __code SUSC_N_PCH = GPIO(H, 1);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(J, 0);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -38,7 +38,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Enable LPC reset on GPD2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +38,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +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(H, 4);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ 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,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +35,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
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// PWRSW WDT 2 Enable 2
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,7 +38,7 @@ struct Gpio __code USB_PWR_EN_N = GPIO(E, 3);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code WLAN_PWR_EN = GPIO(G, 1);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Not documented
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -48,6 +47,5 @@ extern struct Gpio __code VA_EC_EN;
|
||||
#define HAVE_WLAN_EN 0
|
||||
extern struct Gpio __code WLAN_PWR_EN;
|
||||
extern struct Gpio __code XLP_OUT;
|
||||
// clang-format on
|
||||
|
||||
#endif // _BOARD_GPIO_H
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <board/gpio.h>
|
||||
#include <common/macro.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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);
|
||||
@@ -34,7 +34,7 @@ struct Gpio __code SWI_N = GPIO(B, 5);
|
||||
struct Gpio __code USB_PWR_EN_N = GPIO(E, 3);
|
||||
struct Gpio __code VA_EC_EN = GPIO(J, 4);
|
||||
struct Gpio __code XLP_OUT = GPIO(B, 4);
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
void gpio_init(void) {
|
||||
// Not documented
|
||||
|
@@ -7,7 +7,6 @@
|
||||
|
||||
void gpio_init(void);
|
||||
|
||||
// clang-format off
|
||||
extern struct Gpio __code ACIN_N;
|
||||
extern struct Gpio __code AC_PRESENT;
|
||||
extern struct Gpio __code ALL_SYS_PWRGD;
|
||||
@@ -45,6 +44,5 @@ extern struct Gpio __code VA_EC_EN;
|
||||
#define HAVE_WLAN_EN 0
|
||||
#define HAVE_WLAN_PWR_EN 0
|
||||
extern struct Gpio __code XLP_OUT;
|
||||
// clang-format on
|
||||
|
||||
#endif // _BOARD_GPIO_H
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
#include <common/i2c.h>
|
||||
|
||||
// clang-format off
|
||||
int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant {
|
||||
// clang-format on
|
||||
int16_t res = 0;
|
||||
|
||||
res = i2c_start(i2c, addr, true);
|
||||
@@ -20,9 +18,7 @@ int16_t i2c_recv(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint1
|
||||
return res;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
int16_t i2c_send(struct I2C *const i2c, uint8_t addr, uint8_t *const data, uint16_t length) __reentrant {
|
||||
// clang-format on
|
||||
int16_t res = 0;
|
||||
|
||||
res = i2c_start(i2c, addr, false);
|
||||
|
@@ -30,8 +30,6 @@ int16_t i2c_write(struct I2C *const i2c, const uint8_t *const data, uint16_t len
|
||||
// Must be defined by arch, board, or ec
|
||||
int16_t i2c_read(struct I2C *const i2c, uint8_t *const data, uint16_t length) __reentrant;
|
||||
|
||||
// clang-format off
|
||||
|
||||
// Read multiple bytes from address in one transaction
|
||||
int16_t i2c_recv(
|
||||
struct I2C *const i2c,
|
||||
@@ -48,8 +46,6 @@ int16_t i2c_send(
|
||||
uint16_t length
|
||||
) __reentrant;
|
||||
|
||||
// clang-format on
|
||||
|
||||
// Read multiple bytes from a register in one transaction
|
||||
int16_t i2c_get(
|
||||
struct I2C *const i2c,
|
||||
|
@@ -9,26 +9,24 @@
|
||||
#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,
|
||||
0x67, 0x2e, 0x2d, 0x20, 0x12, 0x05, 0x04, 0x5c, 0x68, 0x39, 0x2f, 0x21, 0x14, 0x13, 0x06, 0x5d,
|
||||
0x69, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, 0x5e, 0x6a, 0x72, 0x32, 0x24, 0x16, 0x08, 0x09, 0x5f,
|
||||
0x6b, 0x33, 0x25, 0x17, 0x18, 0x0b, 0x0a, 0x60, 0x6c, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0c, 0x61,
|
||||
0x6d, 0x73, 0x28, 0x74, 0x1a, 0x0d, 0x62, 0x6e, 0x3a, 0x36, 0x1c, 0x1b, 0x75, 0x2b, 0x63, 0x76,
|
||||
0x55, 0x56, 0x77, 0x78, 0x79, 0x7a, 0x0e, 0x7b, 0x7c, 0x4f, 0x7d, 0x4b, 0x47, 0x7e, 0x7f, 0x6f,
|
||||
0x52, 0x53, 0x50, 0x4c, 0x4d, 0x48, 0x01, 0x45, 0x57, 0x4e, 0x51, 0x4a, 0x37, 0x49, 0x46, 0x54,
|
||||
0x80, 0x81, 0x82, 0x41, 0x54, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
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,
|
||||
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,
|
||||
0x67, 0x2e, 0x2d, 0x20, 0x12, 0x05, 0x04, 0x5c, 0x68, 0x39, 0x2f, 0x21, 0x14, 0x13, 0x06, 0x5d,
|
||||
0x69, 0x31, 0x30, 0x23, 0x22, 0x15, 0x07, 0x5e, 0x6a, 0x72, 0x32, 0x24, 0x16, 0x08, 0x09, 0x5f,
|
||||
0x6b, 0x33, 0x25, 0x17, 0x18, 0x0b, 0x0a, 0x60, 0x6c, 0x34, 0x35, 0x26, 0x27, 0x19, 0x0c, 0x61,
|
||||
0x6d, 0x73, 0x28, 0x74, 0x1a, 0x0d, 0x62, 0x6e, 0x3a, 0x36, 0x1c, 0x1b, 0x75, 0x2b, 0x63, 0x76,
|
||||
0x55, 0x56, 0x77, 0x78, 0x79, 0x7a, 0x0e, 0x7b, 0x7c, 0x4f, 0x7d, 0x4b, 0x47, 0x7e, 0x7f, 0x6f,
|
||||
0x52, 0x53, 0x50, 0x4c, 0x4d, 0x48, 0x01, 0x45, 0x57, 0x4e, 0x51, 0x4a, 0x37, 0x49, 0x46, 0x54,
|
||||
0x80, 0x81, 0x82, 0x41, 0x54, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
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,7 +7,6 @@
|
||||
#define __code
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
static const char __code BOARD[] =
|
||||
"76EC_BOARD="
|
||||
xstr(__BOARD__);
|
||||
@@ -15,7 +14,6 @@ static const char __code BOARD[] =
|
||||
static const char __code VERSION[] =
|
||||
"76EC_VERSION="
|
||||
xstr(__FIRMWARE_VERSION__);
|
||||
// clang-format on
|
||||
|
||||
const char *board(void) {
|
||||
return &BOARD[11];
|
||||
|
@@ -134,15 +134,14 @@ static int16_t i2c_transaction(
|
||||
uint32_t timeout = I2C_TIMEOUT;
|
||||
for (timeout = I2C_TIMEOUT; timeout > 0; timeout--) {
|
||||
status = *(i2c->hosta);
|
||||
// If error occured, kill transaction and return error
|
||||
if (status & HOSTA_ERR) {
|
||||
// If error occured, kill transaction and return error
|
||||
i2c_reset(i2c, true);
|
||||
return -(int16_t)(status);
|
||||
} else
|
||||
} else if (status & HOSTA_BYTE_DONE) {
|
||||
// If byte done, break
|
||||
if (status & HOSTA_BYTE_DONE) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If timeout occured, kill transaction and return error
|
||||
if (timeout == 0) {
|
||||
|
@@ -13,13 +13,11 @@ struct VirtualWire {
|
||||
uint8_t valid_mask;
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
#define VIRTUAL_WIRE(INDEX, SHIFT) { \
|
||||
.index = &VWIDX ## INDEX, \
|
||||
.data_mask = BIT(SHIFT), \
|
||||
.valid_mask = BIT(SHIFT + 4), \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
enum VirtualWireState {
|
||||
VWS_INVALID = 0x00,
|
||||
|
@@ -8,13 +8,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// clang-format off
|
||||
#define GPIO_ALT (0b00U << 6)
|
||||
#define GPIO_IN (0b10U << 6)
|
||||
#define GPIO_OUT (0b01U << 6)
|
||||
#define GPIO_UP BIT(2)
|
||||
#define GPIO_DOWN BIT(1)
|
||||
// clang-format on
|
||||
|
||||
struct Gpio {
|
||||
volatile uint8_t __xdata *data;
|
||||
@@ -23,14 +21,12 @@ 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(const struct Gpio *const gpio);
|
||||
void gpio_set(struct Gpio *const gpio, bool value);
|
||||
|
@@ -10,7 +10,6 @@ struct IrqGroup {
|
||||
volatile uint8_t *polarity;
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
#define IRQ_GROUP(nr) { \
|
||||
.status = &ISR ## nr, \
|
||||
.enable = &IER ## nr, \
|
||||
@@ -44,7 +43,6 @@ static const struct IrqGroup irqs[] = {
|
||||
IRQ_GROUP(21),
|
||||
#endif
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
void intc_enable(uint8_t nr) {
|
||||
// XXX: SDCC doesn't optimize division with power-of-2.
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <ec/pmc.h>
|
||||
|
||||
// clang-format off
|
||||
#define PMC(NUM) { \
|
||||
.status = &PM ## NUM ## STS, \
|
||||
.data_out = &PM ## NUM ## DO, \
|
||||
@@ -11,7 +10,6 @@
|
||||
.interrupt_control = &PM ## NUM ## IC, \
|
||||
.interrupt_enable = &PM ## NUM ## IE, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
struct Pmc __code PMC_1 = PMC(1);
|
||||
struct Pmc __code PMC_2 = PMC(2);
|
||||
|
@@ -2,14 +2,12 @@
|
||||
|
||||
#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,7 +2,6 @@
|
||||
|
||||
#include <ec/espi.h>
|
||||
|
||||
// clang-format off
|
||||
#if CONFIG_BUS_ESPI
|
||||
// eSPI signature (byte 7 = 0xA4)
|
||||
static __code const uint8_t __at(0x40) SIGNATURE[16] = {
|
||||
@@ -16,4 +15,3 @@ static __code const uint8_t __at(0x40) SIGNATURE[16] = {
|
||||
0x85, 0x12, 0x5A, 0x5A, 0xAA, 0x00, 0x55, 0x55,
|
||||
};
|
||||
#endif // CONFIG_BUS_ESPI
|
||||
// clang-format on
|
||||
|
@@ -10,8 +10,6 @@ struct WucGroup {
|
||||
volatile uint8_t *enable;
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
|
||||
// Only groups 1, 3, and 4 have WUENR.
|
||||
#define WUC_GROUP_EN(nr) { \
|
||||
.edge = &WUEMR ## nr, \
|
||||
@@ -43,8 +41,6 @@ static const struct WucGroup wuc[] = {
|
||||
WUC_GROUP(14),
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
void wuc_enable(uint8_t nr, enum WucEdgeMode detect) {
|
||||
// XXX: SDCC doesn't optimize division with power-of-2.
|
||||
const uint8_t group = nr >> 3U;
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// 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
|
||||
// uncrustify:off
|
||||
#define LAYOUT( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
@@ -41,7 +41,7 @@
|
||||
/*14*/{ ___, K2D, K57, K1D, ___, K0F, ___, K0G }, \
|
||||
/*15*/{ ___, ___, K3C, ___, K0C, ___, ___, K58 } \
|
||||
}
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
// Position of physical Esc key in the matrix
|
||||
#define MATRIX_ESC_INPUT 7
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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_PAUSE, K_DEL,
|
||||
@@ -23,4 +23,4 @@ LAYOUT(
|
||||
K_LEFT_CTRL, KT_FN, K_LEFT_SUPER, K_LEFT_ALT, K_SPACE, K_RIGHT_ALT, K_APP, K_HOME, K_END, K_PGDN
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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_PAUSE, K_DEL,
|
||||
@@ -23,4 +23,4 @@ LAYOUT(
|
||||
K_LEFT_CTRL, KT_FN, K_LEFT_ALT, K_LEFT_SUPER, K_ESC, K_RIGHT_ALT, K_APP, K_HOME, K_END, K_PGDN
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -13,8 +13,8 @@
|
||||
// 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
|
||||
// uncrustify:off
|
||||
#define LAYOUT( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
@@ -41,8 +41,10 @@
|
||||
{ ___, K2D, K60, K1D, K57, K0F, ___, K0G }, \
|
||||
{ ___, ___, K3C, ___, K61, K0C, ___, K59 } \
|
||||
}
|
||||
// uncrustify:on
|
||||
|
||||
// Conversion of physical ISO layout to keyboard matrix
|
||||
// uncrustify:off
|
||||
#define LAYOUT_ISO( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
@@ -69,7 +71,7 @@
|
||||
{ ___, ___, K60, K1D, K57, K0F, ___, K0G }, \
|
||||
{ ___, ___, K2D, ___, K61, K0C, ___, K59 } \
|
||||
}
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
||||
// Position of physical Esc key in the matrix
|
||||
#define MATRIX_ESC_INPUT 7
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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(
|
||||
@@ -28,4 +28,4 @@ LAYOUT_ISO(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,
|
||||
@@ -25,4 +25,4 @@ LAYOUT(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,
|
||||
@@ -25,4 +25,4 @@ LAYOUT(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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(
|
||||
@@ -31,4 +31,4 @@ LAYOUT_ISO(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,
|
||||
@@ -26,4 +26,4 @@ LAYOUT(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,
|
||||
@@ -25,4 +25,4 @@ LAYOUT(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <board/keymap.h>
|
||||
|
||||
// clang-format off
|
||||
// uncrustify: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,
|
||||
@@ -25,4 +25,4 @@ LAYOUT(
|
||||
K_LEFT, K_DOWN, K_RIGHT
|
||||
)
|
||||
};
|
||||
// clang-format on
|
||||
// uncrustify:on
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user