MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / backlight_read

Function backlight_read

core/backlight.c:12–32  ·  view source on GitHub ↗

Read from the 0xBXXX range of ports */

Source from the content-addressed store, hash-verified

10
11/* Read from the 0xBXXX range of ports */
12static uint8_t backlight_read(const uint16_t pio, bool peek) {
13 uint8_t index = (pio >> 2) & 0xFF;
14 uint8_t value;
15 (void)peek;
16
17 switch (index) {
18 case 0x02: /* Ports B008-B00B always read 0 */
19 case 0x03: /* Ports B00D-B00F always read 0 */
20 case 0x04: /* Ports B00D-B00F always read 0 */
21 case 0x07: /* Ports B01C-B01F always read 0 */
22 value = 0;
23 break;
24 case 0x09:
25 value = backlight.brightness;
26 break;
27 default:
28 value = backlight.ports[index];
29 break;
30 }
31 return value;
32}
33
34/* Write to the 0xBXXX range of ports */
35static void backlight_write(const uint16_t pio, const uint8_t byte, bool poke) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected