summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-10-22 12:01:03 +1100
committerJoel Challis <git@zvecr.com>2019-10-22 02:01:03 +0100
commitaf03c5f7faa93a59d602ffad368868fc361f25e1 (patch)
tree05a426b6703e3e9cd7e6608d44f3f3c0e3d02001
parent165020a670b44ecb8f173d1fba7167952cbd0a4b (diff)
downloadqmk_firmware-af03c5f7faa93a59d602ffad368868fc361f25e1.tar.gz
qmk_firmware-af03c5f7faa93a59d602ffad368868fc361f25e1.zip
Change V60 Polestar RGB timer to 3 (#7099)
-rw-r--r--keyboards/v60_type_r/v60_type_r.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/keyboards/v60_type_r/v60_type_r.c b/keyboards/v60_type_r/v60_type_r.c
index 41eb75807d..5caa149b45 100644
--- a/keyboards/v60_type_r/v60_type_r.c
+++ b/keyboards/v60_type_r/v60_type_r.c
@@ -106,35 +106,35 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
void rgb_timer_init(void) {
- /* Timer1 setup */
+ /* Timer3 setup */
/* CTC mode */
- TCCR1B |= (1<<WGM12);
- /* Clock selelct: clk/8 */
- TCCR1B |= (1<<CS10);
+ TCCR3B |= _BV(WGM32);
+ /* Clock select: clk/8 */
+ TCCR3B |= _BV(CS30);
/* Set TOP value */
uint8_t sreg = SREG;
cli();
- OCR1AH = (SOFTPWM_LED_TIMER_TOP >> 8) & 0xff;
- OCR1AL = SOFTPWM_LED_TIMER_TOP & 0xff;
+ OCR3AH = (SOFTPWM_LED_TIMER_TOP >> 8) & 0xFF;
+ OCR3AL = SOFTPWM_LED_TIMER_TOP & 0xFF;
SREG = sreg;
- // Enable the compare match interrupt on timer 1
- TIMSK1 |= (1<<OCIE1A);
+ // Enable the compare match interrupt on timer 3
+ TIMSK3 |= _BV(OCIE3A);
}
void rgb_init(void) {
- DDRF |= (1<<PF6 | 1<<PF5 | 1<<PF4);
- PORTF |= (1<<PF6 | 1<<PF5 | 1<<PF4);
+ DDRF |= (_BV(PF6) | _BV(PF5) | _BV(PF4));
+ PORTF |= (_BV(PF6) | _BV(PF5) | _BV(PF4));
rgb_timer_init();
}
void set_rgb_pin_on(uint8_t pin) {
- PORTF &= ~(1<<pin);
+ PORTF &= ~_BV(pin);
}
void set_rgb_pin_off(uint8_t pin) {
- PORTF |= (1<<pin);
+ PORTF |= _BV(pin);
}
void rgblight_set(void) {
@@ -151,7 +151,7 @@ void rgblight_set(void) {
// //xprintf("Red: %u, Green: %u, Blue: %u\n", led[0].r, led[0].g, led[0].b);
}
-ISR(TIMER1_COMPA_vect)
+ISR(TIMER3_COMPA_vect)
{
static uint8_t pwm = 0;
pwm++;