🐛 Fix TFT backlight [STM32] (#23062)

This commit is contained in:
Tanguy Pruvot authored and Scott Lahteine committed 2021-12-25 00:46:49 -06:00
1 parent 89ec1c71f0
commit fd136d5501
6 files changed
+22 -8

No files matched your search

+1
View File
@@ -28,6 +28,7 @@
#include "timers.h"
void set_pwm_duty(const pin_t pin, const uint16_t v, const uint16_t v_size/*=255*/, const bool invert/*=false*/) {
if (!PWM_PIN(pin)) return;
timer_dev *timer = PIN_MAP[pin].timer_device;
uint16_t max_val = timer->regs.bas->ARR * v / v_size;
if (invert) max_val = v_size - max_val;