diff --git a/system/hardware/tici/hardware.h b/system/hardware/tici/hardware.h index 20ee88de804224..da89bb9002a052 100644 --- a/system/hardware/tici/hardware.h +++ b/system/hardware/tici/hardware.h @@ -82,17 +82,17 @@ class HardwareTici : public HardwareNone { return; } - percent = std::clamp(percent, 0, 100); + int value = util::map_val(std::clamp(percent, 0, 100), 0, 100, 0, 255); std::ofstream torch_brightness("/sys/class/leds/led:torch_2/brightness"); if (torch_brightness.is_open()) { - torch_brightness << percent << "\n"; + torch_brightness << value << "\n"; torch_brightness.close(); } std::ofstream switch_brightness("/sys/class/leds/led:switch_2/brightness"); if (switch_brightness.is_open()) { - switch_brightness << percent << "\n"; + switch_brightness << value << "\n"; switch_brightness.close(); } }