diff --git a/Makefile b/Makefile index 53c614a..587bb17 100644 --- a/Makefile +++ b/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)","") diff --git a/source/common/hid.c b/source/common/hid.c index 02af949..af67123 100644 --- a/source/common/hid.c +++ b/source/common/hid.c @@ -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) diff --git a/source/common/power.c b/source/common/power.c index 08ea8fb..65f661a 100644 --- a/source/common/power.c +++ b/source/common/power.c @@ -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;