Improved brightness table

This commit is contained in:
al3x10m 2017-08-08 17:47:49 +03:00
parent b56ca0e8b8
commit 9f135f225a

View File

@ -4,12 +4,12 @@
#include "timer.h" #include "timer.h"
#include "pxi.h" #include "pxi.h"
static const u8 br_settings[] = {0x1F, 0x3F, 0x7F, 0xBF}; static const u8 br_settings[] = {0x10, 0x17, 0x1E, 0x25, 0x2C, 0x34, 0x3C, 0x44, 0x4D, 0x56, 0x60, 0x6B, 0x79, 0x8C, 0xA7, 0xD2};
static int prev_brightness = -1; static int prev_brightness = -1;
void CheckBrightness() { void CheckBrightness() {
u8 curSlider; u8 curSlider;
I2C_readRegBuf(I2C_DEV_MCU, 0x09, &curSlider, 1); I2C_readRegBuf(I2C_DEV_MCU, 0x09, &curSlider, 1);
curSlider >>= 4; curSlider >>= 2;
if (curSlider != prev_brightness) { if (curSlider != prev_brightness) {
PXI_Wait(); PXI_Wait();
PXI_Send(br_settings[curSlider]); PXI_Send(br_settings[curSlider]);