| 783 | } |
| 784 | |
| 785 | void OLEDDisplay::setBrightness(uint8_t brightness) { |
| 786 | uint8_t contrast = brightness; |
| 787 | if (brightness < 128) { |
| 788 | // Magic values to get a smooth/ step-free transition |
| 789 | contrast = brightness * 1.171; |
| 790 | } else { |
| 791 | contrast = brightness * 1.171 - 43; |
| 792 | } |
| 793 | |
| 794 | uint8_t precharge = 241; |
| 795 | if (brightness == 0) { |
| 796 | precharge = 0; |
| 797 | } |
| 798 | uint8_t comdetect = brightness / 8; |
| 799 | |
| 800 | setContrast(contrast, precharge, comdetect); |
| 801 | } |
| 802 | |
| 803 | void OLEDDisplay::resetOrientation() { |
| 804 | sendCommand(SEGREMAP); |
nothing calls this directly
no outgoing calls
no test coverage detected