forked from mirrors/qmk_userspace
led
This commit is contained in:
parent
1c6770f18c
commit
d9a1b9086f
6 changed files with 40 additions and 49 deletions
|
@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "action_layer.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
|
@ -55,12 +56,21 @@ uint8_t matrix_cols(void)
|
|||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
static
|
||||
void setup_leds(void) {
|
||||
DDRF |= 0x00;
|
||||
PORTF |= 0x00;
|
||||
}
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
setup_leds();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
|
@ -94,6 +104,18 @@ uint8_t matrix_scan(void)
|
|||
}
|
||||
}
|
||||
|
||||
// uint8_t layer = biton32(default_layer_state);
|
||||
switch (default_layer_state) {
|
||||
case 1:
|
||||
DDRF &= ~(1<<0);
|
||||
PORTF &= ~(1<<0);
|
||||
break;
|
||||
case 2:
|
||||
DDRF |= (1<<0);
|
||||
PORTF |= (1<<0);
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue