| 135 | } |
| 136 | |
| 137 | void OLEDDisplay::setPixel(int16_t x, int16_t y) { |
| 138 | if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) { |
| 139 | switch (color) { |
| 140 | case WHITE: buffer[x + (y / 8) * this->width()] |= (1 << (y & 7)); break; |
| 141 | case BLACK: buffer[x + (y / 8) * this->width()] &= ~(1 << (y & 7)); break; |
| 142 | case INVERSE: buffer[x + (y / 8) * this->width()] ^= (1 << (y & 7)); break; |
| 143 | } |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | void OLEDDisplay::setPixelColor(int16_t x, int16_t y, OLEDDISPLAY_COLOR color) { |
| 148 | if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) { |