Skip to content

Commit

Permalink
Atomic Refactor (qmk#13761)
Browse files Browse the repository at this point in the history
* info.json: human-friendly formatting

- one key per line
- line breaks between physical rows
- four-space indent

* info.json: add data for LAYOUT_grid

* fix keymap paths

This commit corrects the paths for three keymaps that were in the wrong directory.

* refactor and bugfix abienz keymap

- remove extra commas
- use QMK-native aliases for KC_TRNS and KC_NO
- add include for Colemak keycode support
- use four-space indent

* refactor and bugfix michelle keymap

- remove inline comments for keymap layout
- remove extra commas
- use QMK-native aliases for KC_TRNS and KC_NO
- use four-space indent

* refactor and bugfix twolayer keymap

- remove extra commas
- refactor action_get_macro() keycode to QMK-native keycode
- use QMK-native aliases for KC_TRNS
- use four-space indent
- adjust grid alignment

* rename LAYOUT_grid to LAYOUT_ortho_5x15

* refactor config.h file

- use #pragma once include guard
- update MANUFACTURER and PRODUCT strings to be consistent with other OLKB boards
- remove Magic config (all settings are default)

* refactor atomic.c

- add license header
- use GPIO control functions

* refactor atomic.h

- add license header
- use #pragma once include guard
- remove redundant file includes

* refactor rules.mk

- remove Bootloader selection comments
- unify Build Option header comment to QMK template
- unify Build Option rules and inline comments

* alias LAYOUT_grid to LAYOUT_ortho_5x15
  • Loading branch information
noroadsleft committed Jul 29, 2021
1 parent c0149dc commit 8ca6d83
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 354 deletions.
20 changes: 18 additions & 2 deletions keyboards/atomic/atomic.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
/* Copyright 2015 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "atomic.h"

void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up

// Turn status LED on
DDRE |= (1<<6);
PORTE |= (1<<6);
setPinOutput(E6);
writePinHigh(E6);

matrix_init_user();
}
28 changes: 18 additions & 10 deletions keyboards/atomic/atomic.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
#ifndef ATOMIC_H
#define ATOMIC_H
/* Copyright 2015 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "quantum.h"
#include <stddef.h>
#include <avr/io.h>
#include <avr/interrupt.h>

// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout
Expand All @@ -24,7 +36,7 @@
{ K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \
}

#define LAYOUT_grid( \
#define LAYOUT_ortho_5x15( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,\
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E,\
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E,\
Expand All @@ -37,7 +49,3 @@
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E } \
}

#define LAYOUT_ortho_5x15 LAYOUT_grid

#endif
57 changes: 3 additions & 54 deletions keyboards/atomic/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER Ortholinear Keyboards
#define PRODUCT The Atomic Keyboard
#define MANUFACTURER OLKB
#define PRODUCT Atomic

/* key matrix size */
#define MATRIX_ROWS 5
Expand Down Expand Up @@ -85,54 +84,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//#define FORCE_NKRO

/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/

/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false

/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP1 H
//#define MAGIC_KEY_HELP2 SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0_ALT1 ESC
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
#define MAGIC_KEY_BOOTLOADER B
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z

/*
* Feature disable options
* These options are also useful to firmware size reduction.
Expand All @@ -150,5 +101,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION

#endif
173 changes: 165 additions & 8 deletions keyboards/atomic/info.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,168 @@
{
"keyboard_name": "Atomic",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_semi_standard": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2, "w":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3, "w":2}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}]
"keyboard_name": "Atomic",
"maintainer": "jackhumbert",
"width": 15,
"height": 5,
"layout_aliases": {
"LAYOUT_grid": "LAYOUT_ortho_5x15"
},
"layouts": {
"LAYOUT_semi_standard": {
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":4, "y":0},
{"x":5, "y":0},
{"x":6, "y":0},
{"x":7, "y":0},
{"x":8, "y":0},
{"x":9, "y":0},
{"x":10, "y":0},
{"x":11, "y":0},
{"x":12, "y":0},
{"x":13, "y":0, "w":2},

{"x":0, "y":1},
{"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":4, "y":1},
{"x":5, "y":1},
{"x":6, "y":1},
{"x":7, "y":1},
{"x":8, "y":1},
{"x":9, "y":1},
{"x":10, "y":1},
{"x":11, "y":1},
{"x":12, "y":1},
{"x":13, "y":1},
{"x":14, "y":1},

{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":4, "y":2},
{"x":5, "y":2},
{"x":6, "y":2},
{"x":7, "y":2},
{"x":8, "y":2},
{"x":9, "y":2},
{"x":10, "y":2},
{"x":11, "y":2},
{"x":12, "y":2, "w":2},
{"x":14, "y":2},

{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3},
{"x":4, "y":3},
{"x":5, "y":3},
{"x":6, "y":3},
{"x":7, "y":3},
{"x":8, "y":3},
{"x":9, "y":3},
{"x":10, "y":3},
{"x":11, "y":3, "w":2},
{"x":13, "y":3},
{"x":14, "y":3},

{"x":0, "y":4, "w":1.25},
{"x":1.25, "y":4, "w":1.25},
{"x":2.5, "y":4, "w":1.25},
{"x":3.75, "y":4, "w":6.25},
{"x":10, "y":4},
{"x":11, "y":4},
{"x":12, "y":4},
{"x":13, "y":4},
{"x":14, "y":4}
]
},
"LAYOUT_ortho_5x15": {
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":4, "y":0},
{"x":5, "y":0},
{"x":6, "y":0},
{"x":7, "y":0},
{"x":8, "y":0},
{"x":9, "y":0},
{"x":10, "y":0},
{"x":11, "y":0},
{"x":12, "y":0},
{"x":13, "y":0},
{"x":14, "y":0},

{"x":0, "y":1},
{"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":4, "y":1},
{"x":5, "y":1},
{"x":6, "y":1},
{"x":7, "y":1},
{"x":8, "y":1},
{"x":9, "y":1},
{"x":10, "y":1},
{"x":11, "y":1},
{"x":12, "y":1},
{"x":13, "y":1},
{"x":14, "y":1},

{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":4, "y":2},
{"x":5, "y":2},
{"x":6, "y":2},
{"x":7, "y":2},
{"x":8, "y":2},
{"x":9, "y":2},
{"x":10, "y":2},
{"x":11, "y":2},
{"x":12, "y":2},
{"x":13, "y":2},
{"x":14, "y":2},

{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3},
{"x":4, "y":3},
{"x":5, "y":3},
{"x":6, "y":3},
{"x":7, "y":3},
{"x":8, "y":3},
{"x":9, "y":3},
{"x":10, "y":3},
{"x":11, "y":3},
{"x":12, "y":3},
{"x":13, "y":3},
{"x":14, "y":3},

{"x":0, "y":4},
{"x":1, "y":4},
{"x":2, "y":4},
{"x":3, "y":4},
{"x":4, "y":4},
{"x":5, "y":4},
{"x":6, "y":4},
{"x":7, "y":4},
{"x":8, "y":4},
{"x":9, "y":4},
{"x":10, "y":4},
{"x":11, "y":4},
{"x":12, "y":4},
{"x":13, "y":4},
{"x":14, "y":4}
]
}
}
}
}
18 changes: 0 additions & 18 deletions keyboards/atomic/keymaps/abienz.c

This file was deleted.

19 changes: 19 additions & 0 deletions keyboards/atomic/keymaps/abienz/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include QMK_KEYBOARD_H
#include "keymap_colemak.h"

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_5x15(/* Colemak */
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX,
KC_TAB, CM_Q, CM_W, CM_F, CM_P, CM_G, CM_J, CM_L, CM_U, CM_Y, CM_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
KC_BSPC, CM_A, CM_R, CM_S, CM_T, CM_D, CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, KC_ENT, XXXXXXX, KC_PGUP,
KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, CM_K, CM_M, CM_COMM, CM_DOT, CM_SLSH, KC_RSFT, XXXXXXX, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, XXXXXXX, KC_LALT, MO(1), KC_SPC, XXXXXXX, KC_RALT, MO(1), KC_RGUI, XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_ortho_5x15(/* function */
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_MPLY,
_______, _______, XXXXXXX, _______, MO(1), _______, XXXXXXX, _______, MO(1), _______, XXXXXXX, _______, KC_MPRV, KC_VOLD, KC_MNXT
),
};
Loading

0 comments on commit 8ca6d83

Please sign in to comment.