diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-11-17 21:37:34 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-18 16:37:34 +1100 |
| commit | 88eaf78628056d722734392be56e0624dae779e3 (patch) | |
| tree | d84075bc6f59697a490ed0b3c5b739e1d3f91e7d /quantum | |
| parent | aa712b5e288fcda3d537b96cee37e5457f4cf599 (diff) | |
| download | qmk_firmware-88eaf78628056d722734392be56e0624dae779e3.tar.gz qmk_firmware-88eaf78628056d722734392be56e0624dae779e3.zip | |
[Bug] Fix missing variable for Backlight Breathing (#15199)
* [Bug] Fix missing varaible for Backlight Breathing
* Better fix
* formatting
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/backlight/backlight_avr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/quantum/backlight/backlight_avr.c b/quantum/backlight/backlight_avr.c index e3fe56aba..634260800 100644 --- a/quantum/backlight/backlight_avr.c +++ b/quantum/backlight/backlight_avr.c | |||
| @@ -331,9 +331,9 @@ bool is_breathing(void) { return !!(TIMSKx & _BV(TOIEx)); } | |||
| 331 | do { \ | 331 | do { \ |
| 332 | breathing_counter = 0; \ | 332 | breathing_counter = 0; \ |
| 333 | } while (0) | 333 | } while (0) |
| 334 | # define breathing_max() \ | 334 | # define breathing_max() \ |
| 335 | do { \ | 335 | do { \ |
| 336 | breathing_counter = breathing_period * breathing_ISR_frequency / 2; \ | 336 | breathing_counter = get_breathing_period() * breathing_ISR_frequency / 2; \ |
| 337 | } while (0) | 337 | } while (0) |
| 338 | 338 | ||
| 339 | void breathing_enable(void) { | 339 | void breathing_enable(void) { |
| @@ -390,9 +390,9 @@ ISR(TIMERx_OVF_vect) | |||
| 390 | } else { | 390 | } else { |
| 391 | return; | 391 | return; |
| 392 | } | 392 | } |
| 393 | uint16_t interval = (uint16_t)breathing_period * breathing_ISR_frequency / BREATHING_STEPS; | 393 | uint16_t interval = (uint16_t)get_breathing_period() * breathing_ISR_frequency / BREATHING_STEPS; |
| 394 | // resetting after one period to prevent ugly reset at overflow. | 394 | // resetting after one period to prevent ugly reset at overflow. |
| 395 | breathing_counter = (breathing_counter + 1) % (breathing_period * breathing_ISR_frequency); | 395 | breathing_counter = (breathing_counter + 1) % (get_breathing_period() * breathing_ISR_frequency); |
| 396 | uint8_t index = breathing_counter / interval % BREATHING_STEPS; | 396 | uint8_t index = breathing_counter / interval % BREATHING_STEPS; |
| 397 | 397 | ||
| 398 | if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { | 398 | if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) { |
| @@ -454,4 +454,4 @@ void backlight_init_ports(void) { | |||
| 454 | breathing_enable(); | 454 | breathing_enable(); |
| 455 | } | 455 | } |
| 456 | #endif | 456 | #endif |
| 457 | } \ No newline at end of file | 457 | } |
