Skip to content

Commit

Permalink
Add support for 328P hardware backlight on B1/B2 (qmk#6776)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and fdidron committed Nov 4, 2019
1 parent e3e2489 commit 930ab89
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,22 @@ void matrix_scan_quantum() {
# define COMxx1 COM1A1
# define OCRxx OCR1A
# endif
# elif defined(__AVR_ATmega328P__) && (BACKLIGHT_PIN == B1 || BACKLIGHT_PIN == B2)
# define HARDWARE_PWM
# define ICRx ICR1
# define TCCRxA TCCR1A
# define TCCRxB TCCR1B
# define TIMERx_OVF_vect TIMER1_OVF_vect
# define TIMSKx TIMSK1
# define TOIEx TOIE1

# if BACKLIGHT_PIN == B1
# define COMxx1 COM1A1
# define OCRxx OCR1A
# elif BACKLIGHT_PIN == B2
# define COMxx1 COM1B1
# define OCRxx OCR1B
# endif
# else
# if !defined(BACKLIGHT_CUSTOM_DRIVER)
# if !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO)
Expand Down

0 comments on commit 930ab89

Please sign in to comment.