Skip to content

Commit

Permalink
cleanup to not have to set matrix-size in two place
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed May 18, 2024
1 parent 4fa959a commit a9b4b02
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/keyboards/example/layouts/default/layout.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "kbdef.h"
#include "layout.h"
#include "user_layout.h"
#include <stdint.h>

// clang-format off
Expand Down
1 change: 1 addition & 0 deletions src/keyboards/eyooso-z11/layouts/default/layout.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "kbdef.h"
#include "layout.h"
#include "user_layout.h"
#include "report.h"
#include <stdint.h>

Expand Down
1 change: 1 addition & 0 deletions src/keyboards/nuphy-air60/layouts/default/layout.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "kbdef.h"
#include "layout.h"
#include "user_layout.h"
#include "report.h"
#include <stdint.h>

Expand Down
9 changes: 9 additions & 0 deletions src/smk/layout.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef LAYOUT_H
#define LAYOUT_H

#include "kbdef.h"
#include <stdbool.h>

extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];

#endif
1 change: 1 addition & 0 deletions src/smk/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "report.h"
#include "debug.h"
#include "layout.h"
#include "user_layout.h"
#include "indicators.h"
#include "user_matrix.h"
#include "kbdef.h"
Expand Down
1 change: 1 addition & 0 deletions src/smk/report.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "report.h"
#include "host.h"
#include "layout.h"
#include "keycodes.h"
#include <string.h>

static uint8_t real_mods = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/user/layout_process_record.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "layout.h"
#include "user_layout.h"

bool layout_process_record(uint16_t keycode, bool key_pressed)
{
Expand Down
11 changes: 3 additions & 8 deletions src/user/layout.h → src/user/user_layout.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
#ifndef LAYOUT_H
#define LAYOUT_H
#ifndef USER_LAYOUT_H
#define USER_LAYOUT_H

#include "matrix.h"
#include "keycodes.h"
#include <stdint.h>
#include <stdbool.h>

#define MATRIX_ROWS 5
#define MATRIX_COLS 14

extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS];

/*
returns a boolean value to instruct whether further key process should continue or end here
*/
Expand Down

0 comments on commit a9b4b02

Please sign in to comment.