MCPcopy Create free account
hub / github.com/BruceDevices/firmware / ScreenBreath

Method ScreenBreath

lib/utility/AXP192.cpp:129–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void AXP192::ScreenBreath(int brightness) {
130 if (brightness > 100 || brightness < 0) return;
131 int vol = map(brightness, 0, 100, 2500, 3200);
132 vol = (vol < 1800) ? 0 : (vol - 1800) / 100;
133 uint8_t buf = Read8bit(0x28);
134 Write1Byte(0x28, ((buf & 0x0f) | ((uint16_t)vol << 4)));
135}
136
137void AXP192::ScreenSwitch(bool state) {
138 uint8_t brightness;

Callers 1

_setBrightnessFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected