Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/qmk/qmk_firmware: (24 commits)
  CI: Add workflow for CLI testing (qmk#7357)
  Add Prime_L V2 and Prime_EXL Plus (qmk#8111)
  [Keyboard] adding keyboard: neuron (qmk#7980)
  [Keyboard] adding keyboard: pain27 (qmk#7977)
  [Keyboard] adding keyboard: sl40 (qmk#7978)
  [Keyboard] adding keyboard: houndstooth (qmk#7981)
  [Keyboard] adding keyboard: kodachi50 (qmk#7976)
  [Keyboard] adding keyboard: gothic70 (qmk#7982)
  [Keyboard] adding keyboard: gothic50 (qmk#7983)
  [Keyboard] YMDK NP21: matrix and keymap refactor (qmk#8112)
  [Keymap] Added keymap for keebio/nyquist (qmk#8108)
  [Keyboard] Port SPLIT_USB_DETECT to lily58 (qmk#8107)
  [Keymap] Phoebe/Maxr1998 keymap: enable space cadet with curly braces (qmk#8096)
  [Keymap] add lily58 yshrsmz keymap (qmk#8095)
  [Keyboard] Remove i2c write command when reading columns on Ergodox EZ (qmk#8092)
  [Keyboard] Misc tidyups for Chidori (qmk#8091)
  [Keymap] Add users/alfrdmalr and switch to layouts (qmk#8030)
  XD84: Configurator bugfix for ISO layout (qmk#8117)
  ZJ68: complete Configurator layout support (qmk#8116)
  Add QMK Compile Context Sensitivity (qmk#6884)
  ...
  • Loading branch information
Shinichi-Ohki committed Feb 8, 2020
2 parents 1bc1ccb + 75e7018 commit 15a145e
Show file tree
Hide file tree
Showing 134 changed files with 2,977 additions and 3,327 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CLI CI

on:
push:
branches:
- master
- future
pull_request:
paths:
- 'lib/python/**'
- 'bin/qmk'
- 'requirements.txt'
- '.github/workflows/cli.yml'

jobs:
test:
runs-on: ubuntu-latest

container: qmkfm/base_container

steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Run tests
run: bin/qmk pytest
49 changes: 48 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ qmk cformat [file1] [file2] [...] [fileN]

## `qmk compile`

This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm> or compile keymaps in the repo.
This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.

**Usage for Configurator Exports**:

Expand All @@ -95,6 +95,53 @@ qmk compile <configuratorExport.json>
qmk compile -kb <keyboard_name> -km <keymap_name>
```

**Usage in Keyboard Directory**:

Must be in keyboard directory with a default keymap, or in keymap directory for keyboard, or supply one with `--keymap <keymap_name>`
```
qmk compile
```

**Example**:
```
$ qmk config compile.keymap=default
$ cd ~/qmk_firmware/keyboards/planck/rev6
$ qmk compile
Ψ Compiling keymap with make planck/rev6:default
...
```
or with optional keymap argument

```
$ cd ~/qmk_firmware/keyboards/clueboard/66/rev4
$ qmk compile -km 66_iso
Ψ Compiling keymap with make clueboard/66/rev4:66_iso
...
```
or in keymap directory

```
$ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
$ qmk compile
Ψ Compiling keymap with make make gh60/satan:colemak
...
```

**Usage in Layout Directory**:

Must be under `qmk_firmware/layouts/`, and in a keymap folder.
```
qmk compile -kb <keyboard_name>
```

**Example**:
```
$ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi
$ qmk compile -kb dz60
Ψ Compiling keymap with make dz60:mechmerlin-ansi
...
```

## `qmk flash`

This command is similar to `qmk compile`, but can also target a bootloader. The bootloader is optional, and is set to `:flash` by default.
Expand Down
2 changes: 0 additions & 2 deletions keyboards/chidori/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ inline bool board_is_master(board_info_t* board) {
return false;
}

inline uint8_t matrix_rows(void) { return MATRIX_ROWS; }

inline uint8_t matrix2board(uint8_t row) { return row % NUM_ROWS; }

inline uint8_t board_index(uint8_t row) { return row / NUM_ROWS; }
Expand Down
2 changes: 2 additions & 0 deletions keyboards/chidori/chidori.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
* 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 "chidori.h"
68 changes: 33 additions & 35 deletions keyboards/chidori/chidori.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,45 @@
* 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"

// clang-format off
#define LAYOUT( \
L01, L02, L03, L04, L05, L06, R01, R02, R03, R04, R05, R06, \
L07, L08, L09, L10, L11, L12, R07, R08, R09, R10, R11, R12, \
L13, L14, L15, L16, L17, L18, R13, R14, R15, R16, R17, R18, \
L19, L20, L21, L22, L23, L24, R19, R20, R21, R22, R23, R24 \
) \
{ \
{ L01, L02, L03, L04, L05, L06 }, \
{ L07, L08, L09, L10, L11, L12 }, \
{ L13, L14, L15, L16, L17, L18 }, \
{ L19, L20, L21, L22, L23, L24 }, \
{ R01, R02, R03, R04, R05, R06 }, \
{ R07, R08, R09, R10, R11, R12 }, \
{ R13, R14, R15, R16, R17, R18 }, \
{ R19, R20, R21, R22, R23, R24 } \
}
L01, L02, L03, L04, L05, L06, R01, R02, R03, R04, R05, R06, \
L07, L08, L09, L10, L11, L12, R07, R08, R09, R10, R11, R12, \
L13, L14, L15, L16, L17, L18, R13, R14, R15, R16, R17, R18, \
L19, L20, L21, L22, L23, L24, R19, R20, R21, R22, R23, R24 \
) { \
{ L01, L02, L03, L04, L05, L06 }, \
{ L07, L08, L09, L10, L11, L12 }, \
{ L13, L14, L15, L16, L17, L18 }, \
{ L19, L20, L21, L22, L23, L24 }, \
{ R01, R02, R03, R04, R05, R06 }, \
{ R07, R08, R09, R10, R11, R12 }, \
{ R13, R14, R15, R16, R17, R18 }, \
{ R19, R20, R21, R22, R23, R24 } \
}

#define LAYOUT_extended( \
L01, L02, L03, L04, L05, L06, M01, M02, M03, M04, M05, M06, R01, R02, R03, R04, R05, R06, \
L07, L08, L09, L10, L11, L12, M07, M08, M09, M10, M11, M12, R07, R08, R09, R10, R11, R12, \
L13, L14, L15, L16, L17, L18, M13, M14, M15, M16, M17, M18, R13, R14, R15, R16, R17, R18, \
L19, L20, L21, L22, L23, L24, M19, M20, M21, M22, M23, M24, R19, R20, R21, R22, R23, R24 \
) \
{ \
{ L01, L02, L03, L04, L05, L06 }, \
{ L07, L08, L09, L10, L11, L12 }, \
{ L13, L14, L15, L16, L17, L18 }, \
{ L19, L20, L21, L22, L23, L24 }, \
{ M01, M02, M03, M04, M05, M06 }, \
{ M07, M08, M09, M10, M11, M12 }, \
{ M13, M14, M15, M16, M17, M18 }, \
{ M19, M20, M21, M22, M23, M24 }, \
{ R01, R02, R03, R04, R05, R06 }, \
{ R07, R08, R09, R10, R11, R12 }, \
{ R13, R14, R15, R16, R17, R18 }, \
{ R19, R20, R21, R22, R23, R24 } \
}

L01, L02, L03, L04, L05, L06, M01, M02, M03, M04, M05, M06, R01, R02, R03, R04, R05, R06, \
L07, L08, L09, L10, L11, L12, M07, M08, M09, M10, M11, M12, R07, R08, R09, R10, R11, R12, \
L13, L14, L15, L16, L17, L18, M13, M14, M15, M16, M17, M18, R13, R14, R15, R16, R17, R18, \
L19, L20, L21, L22, L23, L24, M19, M20, M21, M22, M23, M24, R19, R20, R21, R22, R23, R24 \
) { \
{ L01, L02, L03, L04, L05, L06 }, \
{ L07, L08, L09, L10, L11, L12 }, \
{ L13, L14, L15, L16, L17, L18 }, \
{ L19, L20, L21, L22, L23, L24 }, \
{ M01, M02, M03, M04, M05, M06 }, \
{ M07, M08, M09, M10, M11, M12 }, \
{ M13, M14, M15, M16, M17, M18 }, \
{ M19, M20, M21, M22, M23, M24 }, \
{ R01, R02, R03, R04, R05, R06 }, \
{ R07, R08, R09, R10, R11, R12 }, \
{ R13, R14, R15, R16, R17, R18 }, \
{ R19, R20, R21, R22, R23, R24 } \
}
// clang-format on
16 changes: 5 additions & 11 deletions keyboards/chidori/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
board_set_led_by_index(0, LED_YELLOW, true);
} else {
board_set_led_by_index(0, LED_YELLOW, false);
}
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
board_set_led_by_index(1, LED_YELLOW, true);
} else {
board_set_led_by_index(1, LED_YELLOW, false);
}
bool led_update_user(led_t led_state) {
board_set_led_by_index(0, LED_YELLOW, led_state.caps_lock);
board_set_led_by_index(1, LED_YELLOW, led_state.scroll_lock);

return false;
}
22 changes: 6 additions & 16 deletions keyboards/chidori/keymaps/extended/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
board_set_led_by_index(0, LED_YELLOW, true);
} else {
board_set_led_by_index(0, LED_YELLOW, false);
}
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
board_set_led_by_index(1, LED_YELLOW, true);
} else {
board_set_led_by_index(1, LED_YELLOW, false);
}
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
board_set_led_by_index(2, LED_YELLOW, true);
} else {
board_set_led_by_index(2, LED_YELLOW, false);
}
bool led_update_user(led_t led_state) {
board_set_led_by_index(0, LED_YELLOW, led_state.caps_lock);
board_set_led_by_index(1, LED_YELLOW, led_state.scroll_lock);
board_set_led_by_index(2, LED_YELLOW, led_state.num_lock);

return false;
}
89 changes: 6 additions & 83 deletions keyboards/chidori/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,100 +14,23 @@ 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 <stdint.h>
#include <stdbool.h>
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "debounce.h"

#include "quantum.h"
#include "matrix.h"
#include "board.h"

#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
# define matrix_bitpop(i) bitpop16(matrix[i])
# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
# define matrix_bitpop(i) bitpop32(matrix[i])
# define ROW_SHIFTER ((uint32_t)1)
#endif

#ifdef MATRIX_MASKED
extern const matrix_row_t matrix_mask[];
#endif

/* matrix state(1:on, 0:off) */
static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
static matrix_row_t matrix[MATRIX_ROWS]; // debounced values

__attribute__((weak)) void matrix_init_quantum(void) { matrix_init_kb(); }

__attribute__((weak)) void matrix_scan_quantum(void) { matrix_scan_kb(); }

__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }

__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }

__attribute__((weak)) void matrix_init_user(void) {}

__attribute__((weak)) void matrix_scan_user(void) {}

inline matrix_row_t matrix_get_row(uint8_t row) {
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
// switch blocker installed and the switch is always pressed.
#ifdef MATRIX_MASKED
return matrix[row] & matrix_mask[row];
#else
return matrix[row];
#endif
}

void matrix_print(void) {
print_matrix_header();

for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row);
print(": ");
print_matrix_row(row);
print("\n");
}
}

void matrix_init(void) {
void matrix_init_custom(void) {
// initialize key pins
board_init();

// initialize matrix state: all keys off
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
raw_matrix[i] = 0;
matrix[i] = 0;
}

debounce_init(MATRIX_ROWS);

matrix_init_quantum();
}

uint8_t matrix_scan(void) {
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
bool changed = false;

// Set row, read cols
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
changed |= board_read_cols_on_row(raw_matrix, current_row);
changed |= board_read_cols_on_row(current_matrix, current_row);
}

debounce(raw_matrix, matrix, MATRIX_ROWS, changed);

matrix_scan_quantum();
return 1;
return changed;
}
6 changes: 1 addition & 5 deletions keyboards/chidori/rules.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# MCU name
MCU = atmega328p
ARCH = AVR8
F_USB = $(F_CPU)

OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT

# Bootloader selection
# Teensy halfkay
Expand Down Expand Up @@ -36,7 +32,7 @@ AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs

CUSTOM_MATRIX = yes
CUSTOM_MATRIX = lite

# project specific files
SRC += matrix.c
Expand Down
Loading

0 comments on commit 15a145e

Please sign in to comment.