Clang format

This commit is contained in:
SGE 2024-04-01 18:11:43 +02:00
parent 6d85a73815
commit 37a73aebd4
3 changed files with 11 additions and 17 deletions

View file

@ -31,8 +31,6 @@ class ICNT86Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice
void reset_touch_sensor_();
InternalGPIOPin *interrupt_pin_{};
GPIOPin *reset_pin_{nullptr};
};
} // namespace icnt86

View file

@ -148,12 +148,10 @@ void Touchscreen::send_touches_() {
}
int16_t Touchscreen::normalize_(int16_t val, int16_t min_val, int16_t max_val, bool inverted) {
int16_t ret;
// only normalize when min and max value are specified
if(min_val && max_val)
{
if (min_val && max_val) {
if (val <= min_val) {
ret = 0;
} else if (val >= max_val) {
@ -161,9 +159,7 @@ if(min_val && max_val)
} else {
ret = (int16_t) ((int) 0xfff * (val - min_val) / (max_val - min_val));
}
}
else
{
} else {
ret = val;
}
ret = (inverted) ? 0xfff - ret : ret;