From ba59fee6f9e307329f15cb5c410835f3380f949c Mon Sep 17 00:00:00 2001 From: Stefan Dorn Date: Sun, 12 Jun 2016 00:58:43 +0100 Subject: [PATCH] tree! --- generate_layout.rb | 2 +- src/keyboard/keyboard.h | 7 +++++-- src/keyboard/{layout_gen.h => layout.c} | 0 src/keyboard/layout.h | 7 +------ src/main.c | 8 ++------ src/makefile | 9 ++++----- 6 files changed, 13 insertions(+), 20 deletions(-) rename src/keyboard/{layout_gen.h => layout.c} (100%) diff --git a/generate_layout.rb b/generate_layout.rb index a9f9e90..f11de0a 100755 --- a/generate_layout.rb +++ b/generate_layout.rb @@ -6,7 +6,7 @@ # require "muflax" LayoutDir = "src/keyboard" -LayoutFile = "#{LayoutDir}/layout_gen.h" +LayoutFile = "#{LayoutDir}/layout.c" puts "generating #{LayoutFile}..." diff --git a/src/keyboard/keyboard.h b/src/keyboard/keyboard.h index 68581f4..77b0df7 100644 --- a/src/keyboard/keyboard.h +++ b/src/keyboard/keyboard.h @@ -21,8 +21,11 @@ * ------------------------------------------------------------------------- */ #pragma once -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- +// -------------------------------------------------------------------- + +#define KB_ROWS 6 // must match real life +#define KB_COLUMNS 14 // must match real life +#define KB_LAYERS 10 // Name ID // PC Mac Unix Boot Keyboard Req. diff --git a/src/keyboard/layout_gen.h b/src/keyboard/layout.c similarity index 100% rename from src/keyboard/layout_gen.h rename to src/keyboard/layout.c diff --git a/src/keyboard/layout.h b/src/keyboard/layout.h index 6a39620..8c74178 100644 --- a/src/keyboard/layout.h +++ b/src/keyboard/layout.h @@ -11,15 +11,10 @@ #include #include #include +#include "./keyboard.h" typedef void (*void_funptr_t)(void); -// -------------------------------------------------------------------- - -#define KB_ROWS 6 // must match real life -#define KB_COLUMNS 14 // must match real life -#define KB_LAYERS 10 - // -------------------------------------------------------------------- uint8_t main_layers_top_layer (void); uint8_t main_layers_top_sticky (void); diff --git a/src/main.c b/src/main.c index cbe1a24..817be62 100644 --- a/src/main.c +++ b/src/main.c @@ -14,16 +14,12 @@ #include #include #include -#include "./keyboard/controller.h" +#include "./keyboard/controller.c" +#include "./keyboard/layout.c" #include "./keyboard/keyboard.h" -#include "./keyboard/layout_gen.h" // ---------------------------------------------------------------------------- -#define KB_ROWS 6 // must match real life -#define KB_COLUMNS 14 // must match real life -#define KB_LAYERS 10 - static bool _main_kb_is_pressed[KB_ROWS][KB_COLUMNS]; bool (*main_kb_is_pressed)[KB_ROWS][KB_COLUMNS] = &_main_kb_is_pressed; diff --git a/src/makefile b/src/makefile index cc6ecd1..6009780 100644 --- a/src/makefile +++ b/src/makefile @@ -21,13 +21,12 @@ BOARD := teensy-2-0 # see the libraries you're using for what's available F_CPU := 16000000 # processor speed, in Hz # firmware stuff -SRC := main.c keyboard/controller.c +SRC := main.c +OBJ := $(SRC:%.c=%.o) # keyboard and layout stuff -# --- remove whitespace from vars -KEYBOARD := $(strip $(KEYBOARD)) -LAYOUT := $(strip $(LAYOUT)) +KEYBOARD := $(strip $(KEYBOARD)) +LAYOUT := $(strip $(LAYOUT)) -OBJ = $(SRC:%.c=%.o) # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .