summaryrefslogtreecommitdiffstats
path: root/keyboards/pearl/pearl.c
diff options
context:
space:
mode:
authorPhil <baldonp1@tcnjedu>2018-04-06 14:01:24 -0400
committerJack Humbert <jack.humb@gmail.com>2018-04-11 23:55:41 -0400
commit3d3716bbf7a7615da237e6a95f6a4684ae8fac44 (patch)
treeb578113897e69e302f83cf88fccdc68bf0034b8e /keyboards/pearl/pearl.c
parent6982e63a4a0ac7832648583a20f082cb913a96e6 (diff)
Beginning implementation of Pearl backlight. Levels and breathing not working yet.
Diffstat (limited to 'keyboards/pearl/pearl.c')
-rw-r--r--keyboards/pearl/pearl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/keyboards/pearl/pearl.c b/keyboards/pearl/pearl.c
index f9ced53bea..3bbadb0a7f 100644
--- a/keyboards/pearl/pearl.c
+++ b/keyboards/pearl/pearl.c
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "pearl.h"
#include "rgblight.h"
+#include "backlight.h"
#include <avr/pgmspace.h>
@@ -39,6 +40,19 @@ void rgblight_set(void) {
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
+void backlight_init_ports(void) {
+ DDRD |= (1<<4);
+ PORTD &= ~(1<<4);
+}
+
+void backlight_set(uint8_t level) {
+ if (level > 0) {
+ PORTD |= (1<<4);
+ } else {
+ PORTD &= ~(1<<4);
+ }
+}
+
__attribute__ ((weak))
void matrix_scan_user(void) {
rgblight_task();