diff options
author | fauxpark <fauxpark@gmail.com> | 2019-09-21 15:11:15 +1000 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2019-12-05 16:03:50 -0800 |
commit | a2c458863e31ab525c700e46810a687c4785258b (patch) | |
tree | 9e997987bc725c0cff551fcf219a7f0d0ab943e6 | |
parent | 69542eaa4b2bf287bbb76cdba65b8b61eb299405 (diff) |
Add support for 328P hardware backlight on B1/B2 (qmk#6776)
-rw-r--r-- | quantum/quantum.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 90df0293b7..030daeca52 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -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) |