Li Ruofan 201199450
Dependencies: mbed Gamepad Joystick
Diff: N5110/N5110.cpp
- Revision:
- 8:b4a2954dd74f
- Parent:
- 0:44c1a60f8732
diff -r e3844250b77d -r b4a2954dd74f N5110/N5110.cpp --- a/N5110/N5110.cpp Fri May 15 22:23:22 2020 +0000 +++ b/N5110/N5110.cpp Sat May 16 17:26:10 2020 +0000 @@ -198,6 +198,16 @@ buffer[x][y/8] |= (1 << y%8); } } +void N5110::setPixel(unsigned int const x, + unsigned int const y, + bool const state) +{ + if (x<WIDTH && y<HEIGHT) { // check within range + // calculate bank and shift 1 to required position in the data byte + if(state) buffer[x][y/8] |= (1 << y%8); + else buffer[x][y/8] &= ~(1 << y%8); + } +} void N5110::clearPixel(unsigned int const x, unsigned int const y)