Skip to content

Commit 3061135

Browse files
committed
Limited backlighting voltage
1 parent 5694877 commit 3061135

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/AXP192.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ void AXP192::ReadBuff(uint8_t Addr, uint8_t Size, uint8_t *Buff) {
154154
}
155155

156156
void AXP192::ScreenBreath(int brightness) {
157+
if (brightness >= 100)
158+
brightness = 100;
159+
else if (brightness < 0)
160+
brightness = 0;
157161
int vol = map(brightness, 0, 100, 2400, 3300);
158162
// Serial.printf("brightness:%d\n", brightness);
159163

0 commit comments

Comments
 (0)