summaryrefslogtreecommitdiffstats
path: root/keyboards/ergodox/infinity/infinity.h
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ergodox/infinity/infinity.h')
-rw-r--r--keyboards/ergodox/infinity/infinity.h71
1 files changed, 41 insertions, 30 deletions
diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h
index fec9e565cd..73a0f4bf70 100644
--- a/keyboards/ergodox/infinity/infinity.h
+++ b/keyboards/ergodox/infinity/infinity.h
@@ -7,13 +7,38 @@ void ergodox_board_led_on(void);
void ergodox_right_led_1_on(void);
void ergodox_right_led_2_on(void);
void ergodox_right_led_3_on(void);
-void ergodox_right_led_on(uint8_t led);
+
+inline void ergodox_right_led_on(uint8_t led) {
+ switch (led) {
+ case 0:
+ ergodox_right_led_1_on();
+ break;
+ case 1:
+ ergodox_right_led_2_on();
+ break;
+ case 2:
+ ergodox_right_led_3_on();
+ break;
+ }
+}
void ergodox_board_led_off(void);
void ergodox_right_led_1_off(void);
void ergodox_right_led_2_off(void);
void ergodox_right_led_3_off(void);
-void ergodox_right_led_off(uint8_t led);
+inline void ergodox_right_led_off(uint8_t led) {
+ switch (led) {
+ case 0:
+ ergodox_right_led_1_off();
+ break;
+ case 1:
+ ergodox_right_led_2_off();
+ break;
+ case 2:
+ ergodox_right_led_3_off();
+ break;
+ }
+}
inline void ergodox_led_all_on(void)
{
@@ -31,36 +56,22 @@ inline void ergodox_led_all_off(void)
ergodox_right_led_3_off();
}
-inline void ergodox_right_led_1_set(uint8_t n){
- if (n) {
- ergodox_right_led_1_on();
- } else {
- ergodox_right_led_1_off();
- }
-}
-
-inline void ergodox_right_led_2_set(uint8_t n){
- if (n) {
- ergodox_right_led_2_on();
- } else {
- ergodox_right_led_2_off();
- }
-}
-
-inline void ergodox_right_led_3_set(uint8_t n){
- if (n) {
- ergodox_right_led_3_on();
- } else {
- ergodox_right_led_3_off();
- }
-}
+void ergodox_right_led_1_set(uint8_t n);
+void ergodox_right_led_2_set(uint8_t n);
+void ergodox_right_led_3_set(uint8_t n);
inline void ergodox_right_led_set(uint8_t led, uint8_t n){
- if (n) {
- ergodox_right_led_on(led);
- } else {
- ergodox_right_led_off(led);
- }
+ switch (led) {
+ case 0:
+ ergodox_right_led_1_set(n);
+ break;
+ case 1:
+ ergodox_right_led_2_set(n);
+ break;
+ case 2:
+ ergodox_right_led_3_set(n);
+ break;
+ }
}
inline void ergodox_led_all_set(uint8_t n) {