diff options
Diffstat (limited to 'src/srp')
-rw-r--r-- | src/srp/fw-ec/fn-lock-1.diff.html | 24 | ||||
-rw-r--r-- | src/srp/fw-ec/fn-lock-2.diff.html | 72 | ||||
-rw-r--r-- | src/srp/fw-ec/hybrid.diff.html | 176 | ||||
-rw-r--r-- | src/srp/fw-ec/index.html | 10 | ||||
-rw-r--r-- | src/srp/fw-ec/kbd-sc-cb.c.html | 12 | ||||
-rw-r--r-- | src/srp/fw-ec/led.diff.html | 64 |
6 files changed, 179 insertions, 179 deletions
diff --git a/src/srp/fw-ec/fn-lock-1.diff.html b/src/srp/fw-ec/fn-lock-1.diff.html index fb48204..9222d4b 100644 --- a/src/srp/fw-ec/fn-lock-1.diff.html +++ b/src/srp/fw-ec/fn-lock-1.diff.html @@ -1,12 +1,12 @@ -<code><span class="diff-meta">diff --git a/board/hx20/board.h b/board/hx20/board.h</span></code> -<code><span class="diff-meta">index 7b4ea288a..cfc6a61a2 100644</span></code> -<code><span class="diff-meta">--- a/board/hx20/board.h</span></code> -<code><span class="diff-meta">+++ b/board/hx20/board.h</span></code> -<code><span class="diff-loc">@@ -218,7 +218,6 @@</span></code> -<code> #define CONFIG_CMD_LEDTEST</code> -<code> #define CONFIG_LED_PWM_COUNT 3</code> -<code> #define CONFIG_LED_PWM_TASK_DISABLED</code> -<code><span class="diff-del">-#define CONFIG_CAPSLED_SUPPORT</span></code> -<code></code> -<code> #ifdef CONFIG_ACCEL_KX022</code> -<code> #define CONFIG_LID_ANGLE</code> +<span class="diff-meta">diff --git a/board/hx20/board.h b/board/hx20/board.h</span> +<span class="diff-meta">index 7b4ea288a..cfc6a61a2 100644</span> +<span class="diff-meta">--- a/board/hx20/board.h</span> +<span class="diff-meta">+++ b/board/hx20/board.h</span> +<span class="diff-loc">@@ -218,7 +218,6 @@</span> + #define CONFIG_CMD_LEDTEST + #define CONFIG_LED_PWM_COUNT 3 + #define CONFIG_LED_PWM_TASK_DISABLED +<span class="diff-del">-#define CONFIG_CAPSLED_SUPPORT</span> + + #ifdef CONFIG_ACCEL_KX022 + #define CONFIG_LID_ANGLE diff --git a/src/srp/fw-ec/fn-lock-2.diff.html b/src/srp/fw-ec/fn-lock-2.diff.html index b3880e0..f1a7a39 100644 --- a/src/srp/fw-ec/fn-lock-2.diff.html +++ b/src/srp/fw-ec/fn-lock-2.diff.html @@ -1,36 +1,36 @@ -<code><span class="diff-meta">diff --git a/board/hx20/keyboard_customization.c b/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-meta">index 2b91f2e0c..9a5050a0f 100644</span></code> -<code><span class="diff-meta">--- a/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-meta">+++ b/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-loc">@@ -249,6 +249,23 @@ int fn_table_set(int8_t pressed, uint32_t fn_bit)</span></code> -<code> return false;</code> -<code> }</code> -<code></code> -<code><span class="diff-ins">+static void hx20_update_fnkey_led(void) {</span></code> -<code><span class="diff-ins">+ /* Turn the capslock light into a fn-lock light */</span></code> -<code><span class="diff-ins">+ gpio_set_level(GPIO_CAP_LED_L, (Fn_key & FN_LOCKED) ? 1 : 0);</span></code> -<code><span class="diff-ins">+}</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+/* Set the fn-lock light to the correct setting when the system resumes */</span></code> -<code><span class="diff-ins">+void hx20_fnkey_resume(void) {</span></code> -<code><span class="diff-ins">+ hx20_update_fnkey_led();</span></code> -<code><span class="diff-ins">+}</span></code> -<code><span class="diff-ins">+DECLARE_HOOK(HOOK_CHIPSET_RESUME, hx20_fnkey_resume, HOOK_PRIO_DEFAULT);</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+/* Disable the fn-lock light on suspend */</span></code> -<code><span class="diff-ins">+void hx20_fnkey_suspend(void) {</span></code> -<code><span class="diff-ins">+ gpio_set_level(GPIO_CAP_LED_L, 0);</span></code> -<code><span class="diff-ins">+}</span></code> -<code><span class="diff-ins">+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, hx20_fnkey_suspend, HOOK_PRIO_DEFAULT);</span></code> -<code><span class="diff-ins">+</span></code> -<code> void fnkey_shutdown(void) {</code> -<code> uint8_t current_kb = 0;</code> -<code></code> -<code><span class="diff-loc">@@ -420,6 +437,7 @@ int functional_hotkey(uint16_t *key_code, int8_t pressed)</span></code> -<code> Fn_key &= ~FN_LOCKED;</code> -<code> else</code> -<code> Fn_key |= FN_LOCKED;</code> -<code><span class="diff-ins">+ hx20_update_fnkey_led();</span></code> -<code> }</code> -<code> return EC_ERROR_UNIMPLEMENTED;</code> -<code> }</code> +<span class="diff-meta">diff --git a/board/hx20/keyboard_customization.c b/board/hx20/keyboard_customization.c</span> +<span class="diff-meta">index 2b91f2e0c..9a5050a0f 100644</span> +<span class="diff-meta">--- a/board/hx20/keyboard_customization.c</span> +<span class="diff-meta">+++ b/board/hx20/keyboard_customization.c</span> +<span class="diff-loc">@@ -249,6 +249,23 @@ int fn_table_set(int8_t pressed, uint32_t fn_bit)</span> + return false; + } + +<span class="diff-ins">+static void hx20_update_fnkey_led(void) {</span> +<span class="diff-ins">+ /* Turn the capslock light into a fn-lock light */</span> +<span class="diff-ins">+ gpio_set_level(GPIO_CAP_LED_L, (Fn_key & FN_LOCKED) ? 1 : 0);</span> +<span class="diff-ins">+}</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+/* Set the fn-lock light to the correct setting when the system resumes */</span> +<span class="diff-ins">+void hx20_fnkey_resume(void) {</span> +<span class="diff-ins">+ hx20_update_fnkey_led();</span> +<span class="diff-ins">+}</span> +<span class="diff-ins">+DECLARE_HOOK(HOOK_CHIPSET_RESUME, hx20_fnkey_resume, HOOK_PRIO_DEFAULT);</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+/* Disable the fn-lock light on suspend */</span> +<span class="diff-ins">+void hx20_fnkey_suspend(void) {</span> +<span class="diff-ins">+ gpio_set_level(GPIO_CAP_LED_L, 0);</span> +<span class="diff-ins">+}</span> +<span class="diff-ins">+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, hx20_fnkey_suspend, HOOK_PRIO_DEFAULT);</span> +<span class="diff-ins">+</span> + void fnkey_shutdown(void) { + uint8_t current_kb = 0; + +<span class="diff-loc">@@ -420,6 +437,7 @@ int functional_hotkey(uint16_t *key_code, int8_t pressed)</span> + Fn_key &= ~FN_LOCKED; + else + Fn_key |= FN_LOCKED; +<span class="diff-ins">+ hx20_update_fnkey_led();</span> + } + return EC_ERROR_UNIMPLEMENTED; + } diff --git a/src/srp/fw-ec/hybrid.diff.html b/src/srp/fw-ec/hybrid.diff.html index a37d3b5..0ad9717 100644 --- a/src/srp/fw-ec/hybrid.diff.html +++ b/src/srp/fw-ec/hybrid.diff.html @@ -1,88 +1,88 @@ -<code><span class="diff-meta">diff --git a/board/hx20/keyboard_customization.c b/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-meta">index 9a5050a0f..2756f17ce 100644</span></code> -<code><span class="diff-meta">--- a/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-meta">+++ b/board/hx20/keyboard_customization.c</span></code> -<code><span class="diff-loc">@@ -22,12 +22,15 @@</span></code> -<code> #define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ## args)</code> -<code> #define CPRINTF(format, args...) cprintf(CC_KEYBOARD, format, ## args)</code> -<code></code> -<code><span class="diff-ins">+/* The scancode for the caps-lock key, which is now a hybrid key */</span></code> -<code><span class="diff-ins">+#define SCANCODE_CTRL_ESC 0x0101</span></code> -<code><span class="diff-ins">+</span></code> -<code> uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = {</code> -<code> {0x0021, 0x007B, 0x0079, 0x0072, 0x007A, 0x0071, 0x0069, 0xe04A},</code> -<code> {0xe071, 0xe070, 0x007D, 0xe01f, 0x006c, 0xe06c, 0xe07d, 0x0077},</code> -<code> {0x0015, 0x0070, 0x00ff, 0x000D, 0x000E, 0x0016, 0x0067, 0x001c},</code> -<code> {0xe011, 0x0011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},</code> -<code><span class="diff-del">- {0xe05a, 0x0029, 0x0024, 0x000c, 0x0058, 0x0026, 0x0004, 0xe07a},</span></code> -<code><span class="diff-ins">+ {0xe05a, 0x0029, 0x0024, 0x000c, 0x0101, 0x0026, 0x0004, 0xe07a},</span></code> -<code> {0x0022, 0x001a, 0x0006, 0x0005, 0x001b, 0x001e, 0x001d, 0x0076},</code> -<code> {0x002A, 0x0032, 0x0034, 0x002c, 0x002e, 0x0025, 0x002d, 0x002b},</code> -<code> {0x003a, 0x0031, 0x0033, 0x0035, 0x0036, 0x003d, 0x003c, 0x003b},</code> -<code><span class="diff-loc">@@ -497,6 +500,55 @@ int functional_hotkey(uint16_t *key_code, int8_t pressed)</span></code> -<code> return EC_SUCCESS;</code> -<code> }</code> -<code></code> -<code><span class="diff-ins">+int try_ctrl_esc(uint16_t *key_code, int8_t pressed) {</span></code> -<code><span class="diff-ins">+ static enum {</span></code> -<code><span class="diff-ins">+ NONE,</span></code> -<code><span class="diff-ins">+ HELD,</span></code> -<code><span class="diff-ins">+ CTRL</span></code> -<code><span class="diff-ins">+ } ctrl_esc_state;</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+ if (*key_code == SCANCODE_CTRL_ESC) {</span></code> -<code><span class="diff-ins">+ /* If we pressed the caps key, enter the HELD state. Otherwise,</span></code> -<code><span class="diff-ins">+ * we are either releasing from the HELD state or the CTRL</span></code> -<code><span class="diff-ins">+ * state. In both cases we should reset the state to NONE, but</span></code> -<code><span class="diff-ins">+ * when releasing from the HELD state we want to send an ESC and</span></code> -<code><span class="diff-ins">+ * when releasing from the CTRL state we want to end the CTRL.</span></code> -<code><span class="diff-ins">+ *</span></code> -<code><span class="diff-ins">+ * Also important to note is that even before we know if we’re</span></code> -<code><span class="diff-ins">+ * going to be acting as ESC or CTRL, we need to send a press-</span></code> -<code><span class="diff-ins">+ * event of the CTRL key because you can chord CTRL with mouse-</span></code> -<code><span class="diff-ins">+ * clicks too, not just other keys.</span></code> -<code><span class="diff-ins">+ */</span></code> -<code><span class="diff-ins">+ if (pressed) {</span></code> -<code><span class="diff-ins">+ ctrl_esc_state = HELD;</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 1);</span></code> -<code><span class="diff-ins">+ } else if (ctrl_esc_state == HELD) {</span></code> -<code><span class="diff-ins">+ ctrl_esc_state = NONE;</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 0);</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_ESC, 1);</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_ESC, 0);</span></code> -<code><span class="diff-ins">+ } else if (ctrl_esc_state == CTRL) {</span></code> -<code><span class="diff-ins">+ ctrl_esc_state = NONE;</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 0);</span></code> -<code><span class="diff-ins">+ }</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+ return EC_ERROR_UNIMPLEMENTED;</span></code> -<code><span class="diff-ins">+ }</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+ /* If we get here then we are dealing with a key that isn’t the caps</span></code> -<code><span class="diff-ins">+ * key. In that case we need to handle all 3 states. If the state is</span></code> -<code><span class="diff-ins">+ * NONE then we can just exit from this function. If it’s HELD and we</span></code> -<code><span class="diff-ins">+ * are pressing a key, then that’s a key-chord and we need to start a</span></code> -<code><span class="diff-ins">+ * CTRL. Finally, if we are in the CTRL state, there is nothing to do.</span></code> -<code><span class="diff-ins">+ */</span></code> -<code><span class="diff-ins">+ if (ctrl_esc_state == HELD && pressed) {</span></code> -<code><span class="diff-ins">+ ctrl_esc_state = CTRL;</span></code> -<code><span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 1);</span></code> -<code><span class="diff-ins">+ }</span></code> -<code><span class="diff-ins">+</span></code> -<code><span class="diff-ins">+ return EC_SUCCESS;</span></code> -<code><span class="diff-ins">+}</span></code> -<code><span class="diff-ins">+</span></code> -<code> enum ec_error_list keyboard_scancode_callback(uint16_t *make_code,</code> -<code> int8_t pressed)</code> -<code> {</code> -<code><span class="diff-loc">@@ -521,6 +573,10 @@ enum ec_error_list keyboard_scancode_callback(uint16_t *make_code,</span></code> -<code> if (!pos_get_state())</code> -<code> return EC_SUCCESS;</code> -<code></code> -<code><span class="diff-ins">+ r = try_ctrl_esc(make_code, pressed);</span></code> -<code><span class="diff-ins">+ if (r != EC_SUCCESS)</span></code> -<code><span class="diff-ins">+ return r;</span></code> -<code><span class="diff-ins">+</span></code> -<code> r = hotkey_F1_F12(make_code, Fn_key, pressed);</code> -<code> if (r != EC_SUCCESS)</code> -<code> return r;</code> +<span class="diff-meta">diff --git a/board/hx20/keyboard_customization.c b/board/hx20/keyboard_customization.c</span> +<span class="diff-meta">index 9a5050a0f..2756f17ce 100644</span> +<span class="diff-meta">--- a/board/hx20/keyboard_customization.c</span> +<span class="diff-meta">+++ b/board/hx20/keyboard_customization.c</span> +<span class="diff-loc">@@ -22,12 +22,15 @@</span> + #define CPRINTS(format, args...) cprints(CC_KEYBOARD, format, ## args) + #define CPRINTF(format, args...) cprintf(CC_KEYBOARD, format, ## args) + +<span class="diff-ins">+/* The scancode for the caps-lock key, which is now a hybrid key */</span> +<span class="diff-ins">+#define SCANCODE_CTRL_ESC 0x0101</span> +<span class="diff-ins">+</span> + uint16_t scancode_set2[KEYBOARD_COLS_MAX][KEYBOARD_ROWS] = { + {0x0021, 0x007B, 0x0079, 0x0072, 0x007A, 0x0071, 0x0069, 0xe04A}, + {0xe071, 0xe070, 0x007D, 0xe01f, 0x006c, 0xe06c, 0xe07d, 0x0077}, + {0x0015, 0x0070, 0x00ff, 0x000D, 0x000E, 0x0016, 0x0067, 0x001c}, + {0xe011, 0x0011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, +<span class="diff-del">- {0xe05a, 0x0029, 0x0024, 0x000c, 0x0058, 0x0026, 0x0004, 0xe07a},</span> +<span class="diff-ins">+ {0xe05a, 0x0029, 0x0024, 0x000c, 0x0101, 0x0026, 0x0004, 0xe07a},</span> + {0x0022, 0x001a, 0x0006, 0x0005, 0x001b, 0x001e, 0x001d, 0x0076}, + {0x002A, 0x0032, 0x0034, 0x002c, 0x002e, 0x0025, 0x002d, 0x002b}, + {0x003a, 0x0031, 0x0033, 0x0035, 0x0036, 0x003d, 0x003c, 0x003b}, +<span class="diff-loc">@@ -497,6 +500,55 @@ int functional_hotkey(uint16_t *key_code, int8_t pressed)</span> + return EC_SUCCESS; + } + +<span class="diff-ins">+int try_ctrl_esc(uint16_t *key_code, int8_t pressed) {</span> +<span class="diff-ins">+ static enum {</span> +<span class="diff-ins">+ NONE,</span> +<span class="diff-ins">+ HELD,</span> +<span class="diff-ins">+ CTRL</span> +<span class="diff-ins">+ } ctrl_esc_state;</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+ if (*key_code == SCANCODE_CTRL_ESC) {</span> +<span class="diff-ins">+ /* If we pressed the caps key, enter the HELD state. Otherwise,</span> +<span class="diff-ins">+ * we are either releasing from the HELD state or the CTRL</span> +<span class="diff-ins">+ * state. In both cases we should reset the state to NONE, but</span> +<span class="diff-ins">+ * when releasing from the HELD state we want to send an ESC and</span> +<span class="diff-ins">+ * when releasing from the CTRL state we want to end the CTRL.</span> +<span class="diff-ins">+ *</span> +<span class="diff-ins">+ * Also important to note is that even before we know if we’re</span> +<span class="diff-ins">+ * going to be acting as ESC or CTRL, we need to send a press-</span> +<span class="diff-ins">+ * event of the CTRL key because you can chord CTRL with mouse-</span> +<span class="diff-ins">+ * clicks too, not just other keys.</span> +<span class="diff-ins">+ */</span> +<span class="diff-ins">+ if (pressed) {</span> +<span class="diff-ins">+ ctrl_esc_state = HELD;</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 1);</span> +<span class="diff-ins">+ } else if (ctrl_esc_state == HELD) {</span> +<span class="diff-ins">+ ctrl_esc_state = NONE;</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 0);</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_ESC, 1);</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_ESC, 0);</span> +<span class="diff-ins">+ } else if (ctrl_esc_state == CTRL) {</span> +<span class="diff-ins">+ ctrl_esc_state = NONE;</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 0);</span> +<span class="diff-ins">+ }</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+ return EC_ERROR_UNIMPLEMENTED;</span> +<span class="diff-ins">+ }</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+ /* If we get here then we are dealing with a key that isn’t the caps</span> +<span class="diff-ins">+ * key. In that case we need to handle all 3 states. If the state is</span> +<span class="diff-ins">+ * NONE then we can just exit from this function. If it’s HELD and we</span> +<span class="diff-ins">+ * are pressing a key, then that’s a key-chord and we need to start a</span> +<span class="diff-ins">+ * CTRL. Finally, if we are in the CTRL state, there is nothing to do.</span> +<span class="diff-ins">+ */</span> +<span class="diff-ins">+ if (ctrl_esc_state == HELD && pressed) {</span> +<span class="diff-ins">+ ctrl_esc_state = CTRL;</span> +<span class="diff-ins">+ simulate_keyboard(SCANCODE_LEFT_CTRL, 1);</span> +<span class="diff-ins">+ }</span> +<span class="diff-ins">+</span> +<span class="diff-ins">+ return EC_SUCCESS;</span> +<span class="diff-ins">+}</span> +<span class="diff-ins">+</span> + enum ec_error_list keyboard_scancode_callback(uint16_t *make_code, + int8_t pressed) + { +<span class="diff-loc">@@ -521,6 +573,10 @@ enum ec_error_list keyboard_scancode_callback(uint16_t *make_code,</span> + if (!pos_get_state()) + return EC_SUCCESS; + +<span class="diff-ins">+ r = try_ctrl_esc(make_code, pressed);</span> +<span class="diff-ins">+ if (r != EC_SUCCESS)</span> +<span class="diff-ins">+ return r;</span> +<span class="diff-ins">+</span> + r = hotkey_F1_F12(make_code, Fn_key, pressed); + if (r != EC_SUCCESS) + return r; diff --git a/src/srp/fw-ec/index.html b/src/srp/fw-ec/index.html index c787191..f528ab9 100644 --- a/src/srp/fw-ec/index.html +++ b/src/srp/fw-ec/index.html @@ -76,7 +76,7 @@ <figcaption> <code>~/board/hx20/led.c</code> </figcaption> - <pre>m4_include(led.diff.html)</pre> + <pre>m4_fmt_code(led.diff.html)</pre> </figure> <p> @@ -115,14 +115,14 @@ <figcaption> <code>~/board/hx20/board.h</code> </figcaption> - <pre>m4_include(fn-lock-1.diff.html)</pre> + <pre>m4_fmt_code(fn-lock-1.diff.html)</pre> </figure> <figure> <figcaption> <code>~/board/hx20/keyboard-customization.c</code> </figcaption> - <pre>m4_include(fn-lock-2.diff.html)</pre> + <pre>m4_fmt_code(fn-lock-2.diff.html)</pre> </figure> <p> @@ -206,7 +206,7 @@ <figure> <figcaption><code>~/board/hx20/keyboard_customization.c</code></figcaption> - <pre>m4_include(hybrid.diff.html)</pre> + <pre>m4_fmt_code(hybrid.diff.html)</pre> </figure> <p> @@ -221,7 +221,7 @@ <code>keyboard_scancode_callback()</code> in <code>~/board/hx20/keyboard_customization.c</code> </figcaption> - <pre>m4_include(kbd-sc-cb.c.html)</pre> + <pre>m4_fmt_code(kbd-sc-cb.c.html)</pre> </figure> <p> diff --git a/src/srp/fw-ec/kbd-sc-cb.c.html b/src/srp/fw-ec/kbd-sc-cb.c.html index ee98ccf..34b7f8d 100644 --- a/src/srp/fw-ec/kbd-sc-cb.c.html +++ b/src/srp/fw-ec/kbd-sc-cb.c.html @@ -1,6 +1,6 @@ -<code><span class="c-cmt">/* “make_code” is the scancode. “pressed” is a boolean that is true if this is a</span></code> -<code><span class="c-cmt"> keydown event, and false if it’s a keyup. */</span></code> -<code></code> -<code>r = <span class="c-fn">my_handler_function</span>(make_code, pressed);</code> -<code><span class="c-kw">if</span> (r != <span class="c-pp">EC_SUCCESS</span>)</code> -<code> <span class="c-kw">return</span> r;</code> +<span class="c-cmt">/* “make_code” is the scancode. “pressed” is a boolean that is true if this is a</span> +<span class="c-cmt"> keydown event, and false if it’s a keyup. */</span> + +r = <span class="c-fn">my_handler_function</span>(make_code, pressed); +<span class="c-kw">if</span> (r != <span class="c-pp">EC_SUCCESS</span>) + <span class="c-kw">return</span> r; diff --git a/src/srp/fw-ec/led.diff.html b/src/srp/fw-ec/led.diff.html index 43f4e4f..9959b0d 100644 --- a/src/srp/fw-ec/led.diff.html +++ b/src/srp/fw-ec/led.diff.html @@ -1,32 +1,32 @@ -<code><span class="diff-meta">diff --git a/board/hx20/led.c b/board/hx20/led.c</span></code> -<code><span class="diff-meta">index a4dc4564e..dacf73fda 100644</span></code> -<code><span class="diff-meta">--- a/board/hx20/led.c</span></code> -<code><span class="diff-meta">+++ b/board/hx20/led.c</span></code> -<code><span class="diff-loc">@@ -283,22 +283,22 @@ static void led_set_power(void)</span></code> -<code> /* don't light up when at lid close */</code> -<code> if (!lid_is_open()) {</code> -<code> set_pwr_led_color(PWM_LED2, -1);</code> -<code><span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0)</span>;</code> -<code><span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0)</span>;</code> -<code> return;</code> -<code> }</code> -<code></code> -<code> if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND))</code> -<code><span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 1)</span>;</code> -<code><span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 1)</span>;</code> -<code> else</code> -<code><span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0)</span>;</code> -<code><span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0)</span>;</code> -<code></code> -<code> if (chipset_in_state(CHIPSET_STATE_ON) | power_button_enable) {</code> -<code> if (charge_prevent_power_on(0))</code> -<code> set_pwr_led_color(PWM_LED2, (power_tick %</code> -<code> LED_TICKS_PER_CYCLE < LED_ON_TICKS) ?</code> -<code><span class="diff-del">- EC_LED_COLOR_WHITE : -1);</span></code> -<code><span class="diff-ins">+ EC_LED_COLOR_GREEN : -1);</span></code> -<code> else</code> -<code><span class="diff-del">- set_pwr_led_color(PWM_LED2, EC_LED_COLOR_WHITE);</span></code> -<code><span class="diff-ins">+ set_pwr_led_color(PWM_LED2, EC_LED_COLOR_GREEN);</span></code> -<code> } else</code> -<code> set_pwr_led_color(PWM_LED2, -1);</code> -<code> }</code> +<span class="diff-meta">diff --git a/board/hx20/led.c b/board/hx20/led.c</span> +<span class="diff-meta">index a4dc4564e..dacf73fda 100644</span> +<span class="diff-meta">--- a/board/hx20/led.c</span> +<span class="diff-meta">+++ b/board/hx20/led.c</span> +<span class="diff-loc">@@ -283,22 +283,22 @@ static void led_set_power(void)</span> + /* don't light up when at lid close */ + if (!lid_is_open()) { + set_pwr_led_color(PWM_LED2, -1); +<span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0)</span>; +<span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0)</span>; + return; + } + + if (chipset_in_state(CHIPSET_STATE_ANY_SUSPEND)) +<span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 1)</span>; +<span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 1)</span>; + else +<span class="diff-del">- enable_pwr_breath(PWM_LED2, EC_LED_COLOR_WHITE, breath_led_length, 0)</span>; +<span class="diff-ins">+ enable_pwr_breath(PWM_LED2, EC_LED_COLOR_GREEN, breath_led_length, 0)</span>; + + if (chipset_in_state(CHIPSET_STATE_ON) | power_button_enable) { + if (charge_prevent_power_on(0)) + set_pwr_led_color(PWM_LED2, (power_tick % + LED_TICKS_PER_CYCLE < LED_ON_TICKS) ? +<span class="diff-del">- EC_LED_COLOR_WHITE : -1);</span> +<span class="diff-ins">+ EC_LED_COLOR_GREEN : -1);</span> + else +<span class="diff-del">- set_pwr_led_color(PWM_LED2, EC_LED_COLOR_WHITE);</span> +<span class="diff-ins">+ set_pwr_led_color(PWM_LED2, EC_LED_COLOR_GREEN);</span> + } else + set_pwr_led_color(PWM_LED2, -1); + } |