If BACKLIGHT_ENABLE is set to `yes` in `rules.mk`, then the user
can use the `BL_*` keycodes to adjust the backlight. At the moment,
only on/off is supported.
+#ifdef BACKLIGHT_ENABLE
+#include "backlight.h"
+#endif
+#ifdef RGBLIGHT_ENABLE
#include <avr/pgmspace.h>
#include <avr/pgmspace.h>
#include "i2c.h"
#include "quantum.h"
#include "i2c.h"
#include "quantum.h"
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
__attribute__ ((weak))
void matrix_scan_user(void) {
__attribute__ ((weak))
void matrix_scan_user(void) {
+}
+
+void backlight_init_ports(void) {
+ DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
+ PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+}
+
+void backlight_set(uint8_t level) {
+ if (level == 0) {
+ // Turn out the lights
+ PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
+ } else {
+ // Turn on the lights
+ PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
+ }
#define DIODE_DIRECTION COL2ROW
#define DEBOUNCING_DELAY 5
#define DIODE_DIRECTION COL2ROW
#define DEBOUNCING_DELAY 5
+#define NO_BACKLIGHT_CLOCK
+#define BACKLIGHT_LEVELS 1
#define RGBLIGHT_ANIMATIONS
#define NO_UART 1
#define RGBLIGHT_ANIMATIONS
#define NO_UART 1
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
SRC = matrix.c i2c.c
# programming options
SRC = matrix.c i2c.c
# programming options
-PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
\ No newline at end of file
+PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex