summaryrefslogtreecommitdiff
path: root/keyboards/ergodox_ez/ergodox_ez.h
diff options
context:
space:
mode:
authorErez Zukerman <bulk@ezuk.org>2017-10-31 11:33:09 -0700
committerGitHub <noreply@github.com>2017-10-31 11:33:09 -0700
commitbc98b0d9eb5eb1a4df140ab6e2158904e5e100e5 (patch)
tree1b2386448402419c79dfa8b447598f7cd2c9141d /keyboards/ergodox_ez/ergodox_ez.h
parent38261920a9c082ceede0d9d31e3a94b9f520e7c8 (diff)
parent0bb457e573e85b3b8f364efdff1eb0c5e4717df9 (diff)
Merge pull request #1915 from dondelelcaro/ergodox_ez_left_leds
Ergodox ez left leds support
Diffstat (limited to 'keyboards/ergodox_ez/ergodox_ez.h')
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/keyboards/ergodox_ez/ergodox_ez.h b/keyboards/ergodox_ez/ergodox_ez.h
index 1f8d597519..a6890a70c5 100644
--- a/keyboards/ergodox_ez/ergodox_ez.h
+++ b/keyboards/ergodox_ez/ergodox_ez.h
@@ -46,12 +46,31 @@ inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6);
inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }
inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); }
+#ifdef LEFT_LEDS
+bool ergodox_left_led_1;
+bool ergodox_left_led_2;
+bool ergodox_left_led_3;
+
+inline void ergodox_left_led_1_on(void) { ergodox_left_led_1 = 1; }
+inline void ergodox_left_led_2_on(void) { ergodox_left_led_2 = 1; }
+inline void ergodox_left_led_3_on(void) { ergodox_left_led_3 = 1; }
+
+inline void ergodox_left_led_1_off(void) { ergodox_left_led_1 = 0; }
+inline void ergodox_left_led_2_off(void) { ergodox_left_led_2 = 0; }
+inline void ergodox_left_led_3_off(void) { ergodox_left_led_3 = 0; }
+#endif // LEFT_LEDS
+
inline void ergodox_led_all_on(void)
{
ergodox_board_led_on();
ergodox_right_led_1_on();
ergodox_right_led_2_on();
ergodox_right_led_3_on();
+#ifdef LEFT_LEDS
+ ergodox_left_led_1_on();
+ ergodox_left_led_2_on();
+ ergodox_left_led_3_on();
+#endif // LEFT_LEDS
}
inline void ergodox_led_all_off(void)
@@ -60,6 +79,11 @@ inline void ergodox_led_all_off(void)
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
+#ifdef LEFT_LEDS
+ ergodox_left_led_1_off();
+ ergodox_left_led_2_off();
+ ergodox_left_led_3_off();
+#endif // LEFT_LEDS
}
inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; }