FrameworkComputer / EmbeddedController

Embedded Controller firmware for the Framework Laptop
BSD 3-Clause "New" or "Revised" License
957 stars 64 forks source link

hx20: FP_LED_LEVEL_CONTROL takes symbolic inputs but returns raw outputs #9

Open DHowett opened 2 years ago

DHowett commented 2 years ago

Calling the FP_LED_LEVEL_CONTROL host command with set requires one of the symbolic LED brightnesses:

However, calling it with get populated returns the actual stored brightness value:

### Write brightness 2 (low)
# ectool raw 0x3e0e b2,b0
3e0e(...2 bytes...)
 02 00                                           |..              |

### Read back (low = 15)
# ectool raw 0x3e0e b0,b1
3e0e(...2 bytes...)
 00 01                                           |..              |
Read 1 bytes
 0f                                              |.               |
hauntingEcho commented 2 years ago

It looks like the relevant code is here: https://github.com/FrameworkComputer/EmbeddedController/blob/hx20/board/hx20/led.c#L400