| 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()) { |
| 149 | switch (color) { |
| 150 | case WHITE: buffer[x + (y / 8) * this->width()] |= (1 << (y & 7)); break; |
| 151 | case BLACK: buffer[x + (y / 8) * this->width()] &= ~(1 << (y & 7)); break; |
| 152 | case INVERSE: buffer[x + (y / 8) * this->width()] ^= (1 << (y & 7)); break; |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | void OLEDDisplay::clearPixel(int16_t x, int16_t y) { |
| 158 | if (x >= 0 && x < this->width() && y >= 0 && y < this->height()) { |