diff options
Diffstat (limited to 'src/srp')
-rw-r--r-- | src/srp/fw-ec/index.html | 98 | ||||
-rw-r--r-- | src/srp/fw-ec/led.diff.html | 32 | ||||
-rw-r--r-- | src/srp/index.html | 49 |
3 files changed, 179 insertions, 0 deletions
diff --git a/src/srp/fw-ec/index.html b/src/srp/fw-ec/index.html new file mode 100644 index 0000000..c04da7f --- /dev/null +++ b/src/srp/fw-ec/index.html @@ -0,0 +1,98 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + m4_include(head.html) + </head> + <body> + <header> + <div> + <h1>Framework is Awesome</h1> + m4_include(nav.html) + </div> + + <figure class="quote"> + <blockquote> + <p>UNIX was not designed to stop its users from doing stupid + things, as that would also stop them from doing clever + things.</p> + </blockquote> + <figcaption> + Doug Gywn + </figcaption> + </figure> + </header> + + <main> + <h2>Framework and the <abbr class="ec">EC</abbr></h2> + + <p> + <a href="https://frame.work" target="_blank"> + Framework + </a> + — for those unaware — is the coolest laptop manufacturer ever. + Their whole <em>shtick</em> is producing laptops that give the + user the ability to easily and effortlessly disassemble, repair, + and modify their hardware. I highly suggest checking them out if + you’re interested in computer hardware at all. The laptops even + have hotswappable I/O! + </p> + + <p> + Anyways getting back on topic, Framework has also been giving + power to the user on the software-side of things too! A good + while ago they open-sourced the + <a href="https://github.com/FrameworkComputer/EmbeddedController"> + code for the embedded controller + </a> + of their laptops, which offers all sorts of possibilities for + customization of the keyboard, + <abbr class="led">LED</abbr> + lights, and more. + </p> + + <h2><abbr class="led">LED</abbr> Fun!</h2> + + <p> + This is an area of the + <abbr class="ec">EC</abbr> + which I have not really looked at or touched much. I do want to + play around with this a lot more in the coming future though! So + far just for shits-and-giggles, I’ve patched the + <abbr class="ec">EC</abbr> + to make the power-button + <abbr class="ec">LED</abbr> + green instead of the normal boring white: + </p> + + <aside> + <p> + Just a tip: if you want to try any of these patches out, + simply copy the diffs and paste them + into <code>git apply</code>. + </p> + </aside> + + <figure> + <figcaption> + <code>~/board/hx20/led.c</code> + </figcaption> + <pre>m4_include(led.diff.html)</pre> + </figure> + + <p> + As you can see, it’s all fairly simple. I just had to change our + <code>EC_LED_COLOR_WHITE</code> for + <code>EC_LED_COLOR_GREEN</code>. The codebase defines a few + colors, but they’re defined as <abbr class="rgb">RGB</abbr> + tuples which is awesome, because it opens the door to + custom <abbr class="rgb">RGB</abbr> effects in the future! + </p> + </main> + + <hr> + + <footer> + m4_include(footer.html) + </footer> + </body> +</html> diff --git a/src/srp/fw-ec/led.diff.html b/src/srp/fw-ec/led.diff.html new file mode 100644 index 0000000..43f4e4f --- /dev/null +++ b/src/srp/fw-ec/led.diff.html @@ -0,0 +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> diff --git a/src/srp/index.html b/src/srp/index.html new file mode 100644 index 0000000..aaf72b1 --- /dev/null +++ b/src/srp/index.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + m4_include(head.html) + </head> + <body> + <header> + <div> + <h1>Software-Related Posts</h1> + m4_include(nav.html) + </div> + + <figure class="quote"> + <blockquote> + <p>Object-oriented programming is an exceptionally bad idea + which could only have originated in California.</p> + </blockquote> + <figcaption> + Edsgar W. Dijkstra + </figcaption> + </figure> + </header> + + <main> + <p> + In this section of the website I cover random software-related + stuff that isn’t related to actual projects of mine. Posts here + could be about anything from a cool program I found, to a patch I + wrote, to me complaining about bad software design. + </p> + + <p> + Posts: + </p> + + <ul> + <li><a href="fw-ec">Patching My Laptops’ Embedded Controller</a></li> + </ul> + </main> + + <hr> + + <footer> + <small> + Page last edited: 30th July 2023, 01:00 CEST + </small> + </footer> + </body> +</html> |