forked from Mirror/GodMode9
Allow disabling the slider and fixing the brightness via the Makefile
Use make FIXED_BRIGHTNESS=x, whereas x is between 0...15
This commit is contained in:
parent
39b76ef5fc
commit
d9ae07bd2b
4
Makefile
4
Makefile
@ -64,8 +64,8 @@ ifeq ($(SWITCH_SCREENS),1)
|
||||
CFLAGS += -DSWITCH_SCREENS
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_SLIDER),1)
|
||||
CFLAGS += -DDISABLE_SLIDER
|
||||
ifdef FIXED_BRIGHTNESS
|
||||
CFLAGS += -DFIXED_BRIGHTNESS=$(FIXED_BRIGHTNESS)
|
||||
endif
|
||||
|
||||
ifneq ("$(wildcard $(CURDIR)/../$(DATA)/README.md)","")
|
||||
|
@ -24,9 +24,7 @@ u32 InputWait(u32 timeout_sec) {
|
||||
return sd_state ? SD_INSERT : SD_EJECT;
|
||||
u8 special_key;
|
||||
if ((timer_msec(timer_mcu) >= 64) && (I2C_readRegBuf(I2C_DEV_MCU, 0x10, &special_key, 1))) {
|
||||
#ifndef DISABLE_SLIDER
|
||||
CheckBrightness();
|
||||
#endif
|
||||
if (special_key == 0x01)
|
||||
return pad_state | BUTTON_POWER;
|
||||
else if (special_key == 0x04)
|
||||
|
@ -7,9 +7,13 @@ static const u8 br_settings[] = {0x10, 0x17, 0x1E, 0x25, 0x2C, 0x34, 0x3C, 0x44,
|
||||
static int prev_brightness = -1;
|
||||
void CheckBrightness() {
|
||||
u8 curSlider;
|
||||
#ifndef FIXED_BRIGHTNESS
|
||||
I2C_readRegBuf(I2C_DEV_MCU, 0x09, &curSlider, 1);
|
||||
// Volume Slider value is always between 0x00 and 0x3F
|
||||
curSlider >>= 2;
|
||||
#else
|
||||
curSlider = FIXED_BRIGHTNESS;
|
||||
#endif
|
||||
if (curSlider != prev_brightness) {
|
||||
PXI_DoCMD(PXI_BRIGHTNESS, (u32[]){br_settings[curSlider]}, 1);
|
||||
prev_brightness = curSlider;
|
||||
|
Loading…
x
Reference in New Issue
Block a user