Skip to content

Commit

Permalink
changes to the template
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhumbert committed Jan 24, 2016
1 parent 6a55a5f commit 24f2698
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 85 deletions.
2 changes: 1 addition & 1 deletion new_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboard/$KEYBOA
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD/config.h
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/keymap_default.c > keyboard/$KEYBOARD/keymaps/keymap_default.c
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default.c > keyboard/$KEYBOARD/keymaps/default.c
cp quantum/template/bootloader.hex keyboard/$KEYBOARD/bootloader.hex

echo "######################################################"
Expand Down
6 changes: 3 additions & 3 deletions quantum/template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ TARGET_DIR = .
SRC = %KEYBOARD%.c

ifdef KEYMAP
SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
SRC := keymaps/$(KEYMAP).c $(SRC)
else
SRC := keymaps/keymap_default.c $(SRC)
SRC := keymaps/default.c $(SRC)
endif

CONFIG_H = config.h
Expand Down Expand Up @@ -107,7 +107,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
OPT_DEFS += -DBOOTLOADER_SIZE=512


# Build Options
Expand Down
6 changes: 3 additions & 3 deletions quantum/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` -

## Macro shortcuts: Send a whole string when pressing just one key

Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c).
Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymaps/default.c).

```c
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is.
Expand Down Expand Up @@ -171,10 +171,10 @@ Depending on which keymap you would like to use, you will have to compile slight
To build with the default keymap, simply run `make`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document (you can find in top README.md) and existent keymap files.
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top README.md) and existent keymap files.
To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
```
$ make KEYMAP=[default|jack|<name>]
```
Keymaps follow the format **__keymap\_\<name\>.c__** and are stored in the `keymaps` folder.
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
8 changes: 4 additions & 4 deletions quantum/template/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION A custom keyboard

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
#define MATRIX_ROWS 2
#define MATRIX_COLS 3

// Planck PCB default pin-out
// Change this to how you wired your keyboard
// COLS: Left to right, ROWS: Top to bottom
#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define ROWS (int []){ D0, D5, B5, B6 }
#define COLS (int []){ F1, F0, B0 }
#define ROWS (int []){ D0, D5 }

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
Expand Down
66 changes: 0 additions & 66 deletions quantum/template/keymaps/keymap_default.c

This file was deleted.

12 changes: 4 additions & 8 deletions quantum/template/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \
k00, k01, k02, \
k10, k11, \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b } \
{ k00, k01, k02 }, \
{ k10, KC_NO, k11 }, \
}

void * matrix_init_user(void);
Expand Down

0 comments on commit 24f2698

Please sign in to comment.