| 176 | } |
| 177 | |
| 178 | void ButtonActions::increaseBrightness() |
| 179 | { |
| 180 | DisplayMgr& displayMgr = DisplayMgr::getInstance(); |
| 181 | uint8_t brightness = displayMgr.getBrightness(); |
| 182 | uint8_t brightnessSoftLimitMin = 0U; |
| 183 | uint8_t brightnessSoftLimitMax = 0U; |
| 184 | |
| 185 | displayMgr.getBrightnessSoftLimits(brightnessSoftLimitMin, brightnessSoftLimitMax); |
| 186 | |
| 187 | if ((UINT8_MAX - BRIGHTNESS_DELTA) < brightness) |
| 188 | { |
| 189 | brightness = UINT8_MAX; |
| 190 | m_incBrightness = false; |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | brightness += BRIGHTNESS_DELTA; |
| 195 | } |
| 196 | |
| 197 | /* Consider soft limit. */ |
| 198 | if (brightnessSoftLimitMax < brightness) |
| 199 | { |
| 200 | brightness = brightnessSoftLimitMax; |
| 201 | m_incBrightness = false; |
| 202 | } |
| 203 | |
| 204 | displayMgr.setBrightness(brightness); |
| 205 | } |
| 206 | |
| 207 | void ButtonActions::decreaseBrightness() |
| 208 | { |
nothing calls this directly
no test coverage detected