diff options
Diffstat (limited to 'keyboards/panc60/panc60.c')
-rw-r--r-- | keyboards/panc60/panc60.c | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c index 16674d30d..6bd16a4bd 100644 --- a/keyboards/panc60/panc60.c +++ b/keyboards/panc60/panc60.c | |||
@@ -13,52 +13,33 @@ | |||
13 | * You should have received a copy of the GNU General Public License | 13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ | 15 | */ |
16 | #include "panc60.h" | ||
17 | #ifdef BACKLIGHT_ENABLE | ||
18 | #include "backlight.h" | ||
19 | #endif | ||
20 | #ifdef RGBLIGHT_ENABLE | ||
21 | #include "rgblight.h" | ||
22 | #endif | ||
23 | |||
24 | #include <avr/pgmspace.h> | ||
25 | |||
26 | #include "action_layer.h" | ||
27 | #include "i2c_master.h" | ||
28 | #include "quantum.h" | ||
29 | |||
30 | __attribute__ ((weak)) | ||
31 | void matrix_scan_user(void) { | ||
32 | } | ||
33 | 16 | ||
34 | #ifdef RGBLIGHT_ENABLE | 17 | #include "panc60.h" |
35 | extern rgblight_config_t rgblight_config; | ||
36 | |||
37 | void rgblight_set(void) { | ||
38 | if (!rgblight_config.enable) { | ||
39 | for (uint8_t i = 0; i < RGBLED_NUM; i++) { | ||
40 | led[i].r = 0; | ||
41 | led[i].g = 0; | ||
42 | led[i].b = 0; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | i2c_init(); | ||
47 | i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100); | ||
48 | } | ||
49 | #endif | ||
50 | 18 | ||
51 | void backlight_init_ports(void) { | 19 | void backlight_init_ports(void) { |
52 | DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 20 | setPinOutput(D0); |
53 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 21 | setPinOutput(D1); |
22 | setPinOutput(D4); | ||
23 | setPinOutput(D6); | ||
24 | |||
25 | writePinLow(D0); | ||
26 | writePinLow(D1); | ||
27 | writePinLow(D4); | ||
28 | writePinLow(D6); | ||
54 | } | 29 | } |
55 | 30 | ||
56 | void backlight_set(uint8_t level) { | 31 | void backlight_set(uint8_t level) { |
57 | if (level == 0) { | 32 | if (level == 0) { |
58 | // Turn out the lights | 33 | // Turn out the lights |
59 | PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); | 34 | writePinLow(D0); |
35 | writePinLow(D1); | ||
36 | writePinLow(D4); | ||
37 | writePinLow(D6); | ||
60 | } else { | 38 | } else { |
61 | // Turn on the lights | 39 | // Turn on the lights |
62 | PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); | 40 | writePinHigh(D0); |
41 | writePinHigh(D1); | ||
42 | writePinHigh(D4); | ||
43 | writePinHigh(D6); | ||
63 | } | 44 | } |
64 | } | 45 | } |