Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mcr.microsoft.com/devcontainers/base:jammy

RUN apt update
RUN apt install -y gcc-arm-none-eabi libftdi1-dev build-essential pkg-config gawk gcc-10
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
25 changes: 25 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
//"image": "mcr.microsoft.com/devcontainers/base:jammy"
"build": {
"dockerfile": "Dockerfile"
}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
24 changes: 24 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@
"problemMatcher": [
"$gcc"
]
},
{
"type": "shell",
"label": "hx30",
"command": "/usr/bin/make",
"args": [
"BOARD=hx30",
"CROSS_COMPILE=arm-none-eabi-",
"-j"
],
"options": {
"cwd": "${workspaceFolder}"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
],
"version": "2.0.0"
Expand Down
11 changes: 6 additions & 5 deletions board/hx20/cypress5525.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,13 @@ void cyp5525_port_int(int controller, int port)
int port_idx = (controller << 1) + port;
enum pd_msg_type sop_type;
rv = i2c_read_offset16_block(i2c_port, addr_flags, CYP5525_PORT_PD_RESPONSE_REG(port), data2, 4);
if (rv != EC_SUCCESS)
if (rv != EC_SUCCESS) {
CPRINTS("PORT_PD_RESPONSE_REG failed");
print_pd_response_code(controller,
port,
data2[0],
data2[1]);
print_pd_response_code(controller,
port,
data2[0],
data2[1]);
}

response_len = data2[1];
switch (data2[0]) {
Expand Down
60 changes: 49 additions & 11 deletions board/hx30/keyboard_customization.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = {
{0x006a, 0x000a, 0xe074, 0xe054, 0x0000, 0x006b, 0x0073, 0x0074},
};

#ifdef CONFIG_KEYBOARD_CUSTOMIZATION_COMBINATION_KEY
#define FN_PRESSED BIT(0)
#define FN_LOCKED BIT(1)
static uint8_t Fn_key;
static uint32_t fn_key_table_media;
static uint32_t fn_key_table;
#endif


uint16_t get_scancode_set2(uint8_t row, uint8_t col)
{
Expand Down Expand Up @@ -141,13 +149,27 @@ int caps_status_check(void)

void hx20_8042_led_control(int data)
{
if (data & CAPS_LED) {
caps_led_status = 1;
gpio_set_level(GPIO_CAP_LED_L, 1);
#ifdef CONFIG_KEYBOARD_CUSTOMIZATION_COMBINATION_KEY
if (Fn_key & FN_PRESSED) {
if (Fn_key & FN_LOCKED) {
caps_led_status = 1;
gpio_set_level(GPIO_CAP_LED_L, 1);
} else {
caps_led_status = 0;
gpio_set_level(GPIO_CAP_LED_L, 0);
}
} else {
caps_led_status = 0;
gpio_set_level(GPIO_CAP_LED_L, 0);
#endif
if (data & CAPS_LED) {
caps_led_status = 1;
gpio_set_level(GPIO_CAP_LED_L, 1);
} else {
caps_led_status = 0;
gpio_set_level(GPIO_CAP_LED_L, 0);
}
#ifdef CONFIG_KEYBOARD_CUSTOMIZATION_COMBINATION_KEY
}
#endif
}

void caps_suspend(void)
Expand Down Expand Up @@ -217,11 +239,7 @@ void board_kblight_init(void)
#endif

#ifdef CONFIG_KEYBOARD_CUSTOMIZATION_COMBINATION_KEY
#define FN_PRESSED BIT(0)
#define FN_LOCKED BIT(1)
static uint8_t Fn_key;
static uint32_t fn_key_table_media;
static uint32_t fn_key_table;


int fn_table_media_set(int8_t pressed, uint32_t fn_bit)
{
Expand Down Expand Up @@ -372,14 +390,34 @@ int hotkey_special_key(uint16_t *key_code, int8_t pressed)
const uint16_t prss_key = *key_code;

switch (prss_key) {
// CUSTOM PWOOLFORD
case SCANCODE_I:
if (fn_table_set(pressed, KB_FN_I))
*key_code = SCANCODE_UP;
break;
case SCANCODE_J:
if (fn_table_set(pressed, KB_FN_J))
*key_code = SCANCODE_LEFT;
break;
case SCANCODE_K:
if (fn_table_set(pressed, KB_FN_K))
*key_code = SCANCODE_DOWN;
break;
case SCANCODE_L:
if (fn_table_set(pressed, KB_FN_L))
*key_code = SCANCODE_RIGHT;
break;
// END CUSTOM PWOOLFORD
case SCANCODE_DELETE: /* TODO: INSERT */
if (fn_table_set(pressed, KB_FN_DELETE))
*key_code = 0xe070;
break;
case SCANCODE_K: /* TODO: SCROLL_LOCK */
/* replaced by IJKL navigation
case SCANCODE_K: // TODO: SCROLL_LOCK
if (fn_table_set(pressed, KB_FN_K))
*key_code = SCANCODE_SCROLL_LOCK;
break;
*/
case SCANCODE_S: /* TODO: SYSRQ */
/*if (!fn_table_set(pressed, KB_FN_S))*/

Expand Down
5 changes: 5 additions & 0 deletions board/hx30/keyboard_customization.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ enum kb_fn_table {
KB_FN_B = BIT(20),
KB_FN_P = BIT(21),
KB_FN_SPACE = BIT(22),

// CUSTOM PWOOLFORD
KB_FN_I = BIT(23),
KB_FN_J = BIT(24),
KB_FN_L = BIT(25)
};

#ifdef CONFIG_KEYBOARD_BACKLIGHT
Expand Down
3 changes: 3 additions & 0 deletions include/keyboard_8042_sharedlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ enum scancode_values {
SCANCODE_FN = 0x00ff,
SCANCODE_ESC = 0x0076,
SCANCODE_DELETE = 0xe071,
SCANCODE_I = 0x0043,
SCANCODE_J = 0x003B,
SCANCODE_K = 0x0042,
SCANCODE_L = 0x004B,
SCANCODE_P = 0x004D,
SCANCODE_S = 0x001B,
SCANCODE_SPACE= 0x0029,
Expand Down