diff options
author | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-10-08 02:10:05 +0000 |
---|---|---|
committer | Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> | 2022-10-08 02:10:05 +0000 |
commit | 0d0a879d7e8f372f7bb3c29bf55318fcbe92f32f (patch) | |
tree | 1c07da1caaaf85c185fbbba5db844382f42d220d /sys | |
parent | 4f6e074f979e185f093f44b20a1021714c479b3b (diff) |
reform/pm: kbdoled: clear the OLED on zero-length write
Diffstat (limited to 'sys')
-rw-r--r-- | sys/man/1/reform | 3 | ||||
-rw-r--r-- | sys/src/cmd/reform/pm.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/sys/man/1/reform b/sys/man/1/reform index c2bc1fa0c..b6afac6f0 100644 --- a/sys/man/1/reform +++ b/sys/man/1/reform @@ -111,7 +111,8 @@ Exposes the current temperature reading of the CPU. .TP .B kbdoled An image can be displayed on the keyboard OLED by writing a 126x32x1 -uncompressed Plan 9 image (with or without a header). +uncompressed Plan 9 image (with or without a header). Zero-length +write clears the display. .TP .B light Provides a way to control the backlight of the built-in LCD by diff --git a/sys/src/cmd/reform/pm.c b/sys/src/cmd/reform/pm.c index 1c15daaf6..c6f609430 100644 --- a/sys/src/cmd/reform/pm.c +++ b/sys/src/cmd/reform/pm.c @@ -157,6 +157,11 @@ loadkbdoled(void *data, int size) int x, y, i, k, v, bpl; u8int *p, q; + if(openkbdhid() != 0) + return -1; + if(size == 0) + return write(kbdhidfd, "WCLR", 4); + bpl = bytesperline(kbdoled->r, kbdoled->depth); if(size == 60+bpl*KbdoledH){ data = (u8int*)data + 60; |