1
0
Fork 0

Beginning implementation of Pearl backlight. Levels and breathing not working yet.

This commit is contained in:
Phil 2018-04-06 14:01:24 -04:00 committed by Jack Humbert
parent 6982e63a4a
commit 3d3716bbf7
4 changed files with 105 additions and 1 deletions

View file

@ -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();