summaryrefslogtreecommitdiff
path: root/keyboards/winkeyless/bface
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/winkeyless/bface')
-rw-r--r--keyboards/winkeyless/bface/README.md4
-rw-r--r--keyboards/winkeyless/bface/backlight_ps2avrGB.c94
-rw-r--r--keyboards/winkeyless/bface/backlight_ps2avrGB.h35
-rw-r--r--keyboards/winkeyless/bface/bface.c81
-rw-r--r--keyboards/winkeyless/bface/bface.h15
-rw-r--r--keyboards/winkeyless/bface/config.h11
-rw-r--r--keyboards/winkeyless/bface/i2c.c104
-rw-r--r--keyboards/winkeyless/bface/i2c.h25
-rw-r--r--keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c4
-rw-r--r--keyboards/winkeyless/bface/keymaps/p3lim/README.md14
-rw-r--r--keyboards/winkeyless/bface/keymaps/p3lim/keymap.c156
-rw-r--r--keyboards/winkeyless/bface/matrix.c113
-rw-r--r--keyboards/winkeyless/bface/rules.mk44
-rw-r--r--keyboards/winkeyless/bface/usbconfig.h17
14 files changed, 239 insertions, 478 deletions
diff --git a/keyboards/winkeyless/bface/README.md b/keyboards/winkeyless/bface/README.md
index f1789b04cf..da0eb8088b 100644
--- a/keyboards/winkeyless/bface/README.md
+++ b/keyboards/winkeyless/bface/README.md
@@ -14,6 +14,8 @@ Flashing
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
+**Reset Key:** Hold down the key located at K00, commonly programmed as left control while plugging in the keyboard.
+
Windows:
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
2. Place your keyboard into reset.
@@ -33,7 +35,7 @@ macOS:
3. Install the following packages:
```
brew install python
- brew install pyusb
+ pip3 install pyusb
brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
```
diff --git a/keyboards/winkeyless/bface/backlight_ps2avrGB.c b/keyboards/winkeyless/bface/backlight_ps2avrGB.c
deleted file mode 100644
index c0f6428407..0000000000
--- a/keyboards/winkeyless/bface/backlight_ps2avrGB.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright 2017 Sebastian Kaim
- *
- * 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/>.
- */
-
-#ifdef BACKLIGHT_ENABLE
-
-#include "backlight_ps2avrGB.h"
-#define sbi(reg,bit) reg |= (_BV(bit))
-#define cbi(reg,bit) reg &= (~_BV(bit))
-#define PWM10 WGM10
-#define PWM11 WGM11
-#define COM1x1 COM1B1
-#define OCR1x OCR1B
-
-void backlight_init_ports(void)
-{
-#if BACKLIGHT_ON_STATE == 0
- backlight_off();
-#else
- backlight_on();
-#endif
-
- // setup pwm
- // this bitmagic is sourced from the original firmware
- /*TCCR1B = ((TCCR1B & ~0x07) | 0x03);
- TCNT1H = 0;
- TCNT1L = 0;
- sbi(TIMSK, TOIE1);
- OCR1BH = 0;
- OCR1BL = 0;
- cbi(TCCR1A,PWM11);
- sbi(TCCR1A,PWM10);
- sbi(TCCR1A,COM1B1);
- cbi(TCCR1A,COM1B0);*/
- ICR1 = 0xFFFF;
-
- TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010;
- TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
-
- backlight_init();
-}
-
-void backlight_set(uint8_t level)
-{
- if( level == 0 ) {
- backlight_off();
- }
- else {
- backlight_on();
- /*uint8_t pwm = get_pwm_for_brightness(level);
- set_backlight_pwm(pwm);
- TCCR1A |= _BV(COM1x1);
- OCR1x = (level >= 2) ? 0xFFFF : 0x00FF;*/
- }
-}
-
-#define PWM_MAX 0xFF
-uint8_t get_pwm_for_brightness(uint8_t level)
-{
- // we need to cast up here to allow multiplication with 0xFF. We could also use floats, but this is probably a lot faster.
- uint16_t brightness = (uint16_t)level * (uint16_t)PWM_MAX / (uint16_t)BACKLIGHT_LEVELS;
- return (uint8_t)brightness;
-}
-
-void backlight_on(void)
-{
- //_SFR_IO8(0x12) |= _BV(0x4);
- LED_PIN |= BACKLIGHT_PORT_NUM;
-}
-
-void backlight_off(void)
-{
- //_SFR_IO8(0x12) &= ~_BV(0x4);
- LED_PIN &= ~BACKLIGHT_PORT_NUM;
-}
-
-void set_backlight_pwm(uint8_t level) {
- // this does not work (yet)
- //OCR1B = level;
-}
-
-#endif // BACKLIGHT_ENABLE
diff --git a/keyboards/winkeyless/bface/backlight_ps2avrGB.h b/keyboards/winkeyless/bface/backlight_ps2avrGB.h
deleted file mode 100644
index d5ca903993..0000000000
--- a/keyboards/winkeyless/bface/backlight_ps2avrGB.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright 2017 Sebastian Kaim
- *
- * 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/>.
- */
-
-
-#if defined(__AVR__)
-#include <avr/pgmspace.h>
-#include <avr/io.h>
-#include <avr/interrupt.h>
-#endif
-#include <stddef.h>
-#include <stdlib.h>
-#include "backlight.h"
-
-#ifndef PS2AVRGB_BACKLIGHT_H
-#define PS2AVRGB_BACKLIGHT_H
-
-uint8_t get_pwm_for_brightness(uint8_t level);
-void set_backlight_pwm(uint8_t level);
-void backlight_on(void);
-void backlight_off(void);
-
-#endif
diff --git a/keyboards/winkeyless/bface/bface.c b/keyboards/winkeyless/bface/bface.c
index 8422a4a40b..8cb5b600cd 100644
--- a/keyboards/winkeyless/bface/bface.c
+++ b/keyboards/winkeyless/bface/bface.c
@@ -1,46 +1,47 @@
-/*
-Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-Copyright 2018 Sebastian Kaim <sebb@sebb767.de>
-
-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/>.
-*/
+/* Copyright 2019 MechMerlin
+ *
+ * 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 "bface.h"
-#include "rgblight.h"
-
-#include <avr/pgmspace.h>
-
-#include "action_layer.h"
-#include "i2c.h"
-#include "quantum.h"
-extern rgblight_config_t rgblight_config;
-
-void rgblight_set(void) {
- if (!rgblight_config.enable) {
- for (uint8_t i = 0; i < RGBLED_NUM; i++) {
- led[i].r = 0;
- led[i].g = 0;
- led[i].b = 0;
- }
- }
-
- i2c_init();
- i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
+void backlight_init_ports(void) {
+ // initialize pins D0, D1, D4 and D6 as output
+ setPinOutput(D0);
+ setPinOutput(D1);
+ setPinOutput(D4);
+ setPinOutput(D6);
+
+ // turn backlight LEDs on
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
}
-__attribute__ ((weak))
-void matrix_scan_user(void) {
- rgblight_task();
+void backlight_set(uint8_t level) {
+ if (level == 0) {
+ // turn backlight LEDs off
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
+ } else {
+ // turn backlight LEDs on
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
+ }
}
diff --git a/keyboards/winkeyless/bface/bface.h b/keyboards/winkeyless/bface/bface.h
index 62d62f6953..bca0c24c1a 100644
--- a/keyboards/winkeyless/bface/bface.h
+++ b/keyboards/winkeyless/bface/bface.h
@@ -16,19 +16,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 KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
+#pragma once
-#include "quantum_keycodes.h"
-#include "keycode.h"
-#include "action.h"
+#include "quantum.h"
#define LAYOUT_60_ansi( \
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, \
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, \
- K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, \
- K00, K10, K20, K56, K57, KA0, KB0, KC0 \
+ K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, \
+ K00, K10, K20, K56, K57, KA0, KB0, KC0 \
){ \
{ K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KA0, KB0, KC0, KC_NO, KC_NO }, \
{ K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KC_NO, KC_NO }, \
@@ -37,8 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \
- { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \
+ { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \
}
-
-#endif
diff --git a/keyboards/winkeyless/bface/config.h b/keyboards/winkeyless/bface/config.h
index 11ac373c02..9d90e16a3d 100644
--- a/keyboards/winkeyless/bface/config.h
+++ b/keyboards/winkeyless/bface/config.h
@@ -16,11 +16,11 @@ 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
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
+#define DEVICE_VER 0x0200
// You can edit those at usbconfig.h about line 250. These values will
// unforunatly be ignored so far
#define MANUFACTURER winkeyless.kr
@@ -30,11 +30,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 8
#define MATRIX_COLS 15
+// 0 1 2 3 4 5 6 7 8 9 A B C D E
+#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
+#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7}
+#define UNUSED_PINS
+
#define RGBLED_NUM 16
#define RGBLIGHT_ANIMATIONS
#define NO_UART 1
-#define BOOTLOADHID_BOOTLOADER 1
#ifdef BACKLIGHT_ENABLE
// the backlight PWM does not work (yet). Therefore, we only have two backlight levels (on/off)
@@ -43,4 +47,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PORT_NUM (1 << 4)
#endif
-#endif
diff --git a/keyboards/winkeyless/bface/i2c.c b/keyboards/winkeyless/bface/i2c.c
deleted file mode 100644
index c27f3e3d17..0000000000
--- a/keyboards/winkeyless/bface/i2c.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
-
-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 <avr/io.h>
-#include <util/twi.h>
-
-#include "i2c.h"
-
-void i2c_set_bitrate(uint16_t bitrate_khz) {
- uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
- if (bitrate_div >= 16) {
- bitrate_div = (bitrate_div - 16) / 2;
- }
- TWBR = bitrate_div;
-}
-
-void i2c_init(void) {
- // set pull-up resistors on I2C bus pins
- PORTC |= 0b11;
-
- i2c_set_bitrate(400);
-
- // enable TWI (two-wire interface)
- TWCR |= (1 << TWEN);
-
- // enable TWI interrupt and slave address ACK
- TWCR |= (1 << TWIE);
- TWCR |= (1 << TWEA);
-}
-
-uint8_t i2c_start(uint8_t address) {
- // reset TWI control register
- TWCR = 0;
-
- // begin transmission and wait for it to end
- TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
- while (!(TWCR & (1<<TWINT)));
-
- // check if the start condition was successfully transmitted
- if ((TWSR & 0xF8) != TW_START) {
- return 1;
- }
-
- // transmit address and wait
- TWDR = address;
- TWCR = (1<<TWINT) | (1<<TWEN);
- while (!(TWCR & (1<<TWINT)));
-
- // check if the device has acknowledged the READ / WRITE mode
- uint8_t twst = TW_STATUS & 0xF8;
- if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
- return 1;
- }
-
- return 0;
-}
-
-void i2c_stop(void) {
- TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
-}
-
-uint8_t i2c_write(uint8_t data) {
- TWDR = data;
-
- // transmit data and wait
- TWCR = (1<<TWINT) | (1<<TWEN);
- while (!(TWCR & (1<<TWINT)));
-
- if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
- return 1;
- }
-
- return 0;
-}
-
-uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
- if (i2c_start(address)) {
- return 1;
- }
-
- for (uint16_t i = 0; i < length; i++) {
- if (i2c_write(data[i])) {
- return 1;
- }
- }
-
- i2c_stop();
-
- return 0;
-}
diff --git a/keyboards/winkeyless/bface/i2c.h b/keyboards/winkeyless/bface/i2c.h
deleted file mode 100644
index 27c9d3d050..0000000000
--- a/keyboards/winkeyless/bface/i2c.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
-
-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/>.
-*/
-
-#ifndef __I2C_H__
-#define __I2C_H__
-
-void i2c_init(void);
-void i2c_set_bitrate(uint16_t bitrate_khz);
-uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
-
-#endif
diff --git a/keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c b/keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c
index 84de7872f4..8d6e4da77c 100644
--- a/keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c
+++ b/keyboards/winkeyless/bface/keymaps/kpeatt/keymap.c
@@ -73,7 +73,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
______,______,______, ______, ______,______,______,______
), // */
};
-
-const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_LAYER_MOMENTARY(1),
-};
diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/README.md b/keyboards/winkeyless/bface/keymaps/p3lim/README.md
new file mode 100644
index 0000000000..81f99ec966
--- /dev/null
+++ b/keyboards/winkeyless/bface/keymaps/p3lim/README.md
@@ -0,0 +1,14 @@
+# p3lim's b.face layout
+
+![](https://user-images.githubusercontent.com/26496/61170794-bf8a2c80-a56e-11e9-893f-f1766e7a9a04.png)
+
+My layout using the winkeyless b.face X2 PCB. The keys indicated with a gray color was not supported by the layout so a custom one was made.
+
+### Building & Flashing
+
+- Hold <kbd>LCTRL</kbd> while connecting to put in flashing mode
+- Follow instructions in the main _bface_ directory
+
+### Layout notes
+
+The two additional keys were on pins 22+41 and 22+42, C3+B1 and C3+B2, which is mapped to col 10 row 1 and col 10 row 2 in the matrix.
diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c
new file mode 100644
index 0000000000..0ec1245291
--- /dev/null
+++ b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c
@@ -0,0 +1,156 @@
+/*
+Copyright 2019 Adrian L Lange <legal@p3lim.net>
+
+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 QMK_KEYBOARD_H
+#include "quantum.h"
+
+#define LAYOUT_p3lim(\
+ K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \
+ K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, \
+ K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, \
+ K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, KC1, \
+ K00, K10, K20, K56, K57, KB0, KC0 \
+){ \
+ { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KC_NO, KC_NO }, \
+ { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC1, KC_NO, KC_NO }, \
+ { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC2, KD2, KC_NO }, \
+ { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KC_NO, KC_NO }, \
+ { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
+ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
+ { KC_NO, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \
+ { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \
+}
+
+enum my_keycodes {
+ C_ESC0 = SAFE_RANGE, // layer 0 esc
+ C_ESC1 // layer 1 esc
+};
+
+// use compiler macros for simpler stuff
+#define C_NO1 RALT(KC_QUOT)
+#define C_NO2 RALT(KC_SCLN)
+#define C_NO3 RALT(KC_LBRC)
+#define C_KVM1 LCA(KC_1)
+#define C_KVM2 LCA(KC_2)
+#define C_KVM3 LCA(KC_3)
+#define C_KVM4 LCA(KC_4)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* QWERTY
+ * ,-----------------------------------------------------------------------------------------.
+ * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
+ * |-----------------------------------------------------------------------------------------+
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | |
+ * |---------------------------------------------------------------------------------| Enter |
+ * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | \ | |
+ * |-----------------------------------------------------------------------------------------+
+ * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Del |
+ * |-----------------------------------------------------------------------------------------+
+ * | FN1 | Alt | GUI | Space | FN2 | Alt | Ctrl |
+ * `-----------------------------------------------------------------------------------------'
+ */
+ [0] = LAYOUT_p3lim(
+ C_ESC0, 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,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
+ MO(1), KC_LALT, KC_LGUI, KC_SPC, MO(2), KC_RGUI, KC_RCTL
+ ),
+
+ /* FN1
+ * ,-----------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
+ * |-----------------------------------------------------------------------------------------+
+ * | Caps | Home| Up | End | PgUp| | | | | | | | | |
+ * |---------------------------------------------------------------------------------| |
+ * | | Left| Down|Right| PgDn| | | | | | | | | |
+ * |-----------------------------------------------------------------------------------------+
+ * | | KVM1| KVM2| KVM3| KVM4| | | | | | | | |
+ * |-----------------------------------------------------------------------------------------+
+ * | | | | | | | |
+ * `-----------------------------------------------------------------------------------------'
+ */
+ [1] = LAYOUT_p3lim(
+ C_ESC1, 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_CAPS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, C_KVM1, C_KVM2, C_KVM3, C_KVM4, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, KC_NO, _______, _______
+ ),
+
+ /* FN2
+ * ,-----------------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | | | |
+ * |-----------------------------------------------------------------------------------------+
+ * | | | | | | | | | | | | Å | | |
+ * |---------------------------------------------------------------------------------| |
+ * | | | | | | | | | | | Ø | Æ | | |
+ * |-----------------------------------------------------------------------------------------+
+ * | | | | | | | | | | | | | |
+ * |-----------------------------------------------------------------------------------------+
+ * | | | | | | | |
+ * `-----------------------------------------------------------------------------------------'
+ */
+ [2] = LAYOUT_p3lim(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_NO3, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_NO2, C_NO1, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ KC_NO, _______, _______, _______, _______, _______, _______
+ ),
+ /*
+ [n] = LAYOUT_p3lim(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______
+ ),
+ */
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record){
+ switch(keycode){
+ case C_ESC0: // layer 0
+ if(record->event.pressed){
+ if(get_mods() & MOD_MASK_SHIFT)
+ register_code(KC_GRAVE);
+ else
+ register_code(KC_ESCAPE);
+ } else {
+ if(get_mods() & MOD_MASK_SHIFT)
+ unregister_code(KC_GRAVE);
+ else
+ unregister_code(KC_ESCAPE);
+ }
+ return false;
+ case C_ESC1: // layer 1
+ if(record->event.pressed){
+ if(get_mods() & MOD_MASK_SHIFT)
+ register_code(KC_ESCAPE);
+ else
+ register_code(KC_GRAVE);
+ } else {
+ if(get_mods() & MOD_MASK_SHIFT)
+ unregister_code(KC_ESCAPE);
+ else
+ unregister_code(KC_GRAVE);
+ }
+ return false;
+ }
+ return true;
+}
diff --git a/keyboards/winkeyless/bface/matrix.c b/keyboards/winkeyless/bface/matrix.c
deleted file mode 100644
index b3761a63ca..0000000000
--- a/keyboards/winkeyless/bface/matrix.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-
-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 <avr/io.h>
-#include <util/delay.h>
-
-#include "matrix.h"
-
-#ifndef DEBOUNCE
-# define DEBOUNCE 5
-#endif
-
-static uint8_t debouncing = DEBOUNCE;
-
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-void matrix_init(void) {
- // all outputs for rows high
- DDRB = 0xFF;
- PORTB = 0xFF;
- // all inputs for columns
- DDRA = 0x00;
- DDRC &= ~(0x111111<<2);
- DDRD &= ~(1<<PIND7);
- // all columns are pulled-up
- PORTA = 0xFF;
- PORTC |= (0b111111<<2);
- PORTD |= (1<<PIND7);
-
- // initialize matrix state: all keys off
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix[row] = 0x00;
- matrix_debouncing[row] = 0x00;
- }
-
- // activate backlight
- //PORTD |= (1 << 4);
- //_SFR_IO8(0x09) |= (1 << 4); //_BV(0x94 & 0xF);
- //
- // this is the code that *should* be executed in quantum.c
- _SFR_IO8(0x12) |= _BV(0x4);
-}
-
-void matrix_set_row_status(uint8_t row) {
- DDRB = (1 << row);
- PORTB = ~(1 << row);
-}
-
-uint8_t bit_reverse(uint8_t x) {
- x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
- x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
- x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
- return x;
-}
-
-uint8_t matrix_scan(void) {
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix_set_row_status(row);
- _delay_us(5);
-
- matrix_row_t cols = (
- // cols 0..7, PORTA 0 -> 7
- (~PINA) & 0xFF
- ) | (
- // cols 8..13, PORTC 7 -> 0
- bit_reverse((~PINC) & 0xFF) << 8
- ) | (
- // col 14, PORTD 7
- ((~PIND) & (1 << PIND7)) << 7
- );
-
- if (matrix_debouncing[row] != cols) {
- matrix_debouncing[row] = cols;
- debouncing = DEBOUNCE;
- }
- }
-
- if (debouncing) {
- if (--debouncing) {
- _delay_ms(1);
- } else {
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = matrix_debouncing[i];
- }
- }
- }
-
- matrix_scan_user();
-
- return 1;
-}
-
-inline matrix_row_t matrix_get_row(uint8_t row) {
- return matrix[row];
-}
-
-void matrix_print(void) {
-}
diff --git a/keyboards/winkeyless/bface/rules.mk b/keyboards/winkeyless/bface/rules.mk
index 369ccf2eda..506e37ac9c 100644
--- a/keyboards/winkeyless/bface/rules.mk
+++ b/keyboards/winkeyless/bface/rules.mk
@@ -1,31 +1,18 @@
-# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-#
-# 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/>.
-
# MCU name
MCU = atmega32a
-PROTOCOL = VUSB
-
-# unsupported features for now
-NO_UART = yes
-NO_SUSPEND_POWER_DOWN = yes
-# processor frequency
-F_CPU = 12000000
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = bootloadHID
# build options
-BOOTMAGIC_ENABLE = yes
+BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
@@ -34,15 +21,6 @@ BACKLIGHT_ENABLE = yes
BACKLIGHT_CUSTOM_DRIVER = yes
BACKLIGHT_BREATHING = no
RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
+WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-OPT_DEFS += -DBOOTLOADER_SIZE=2048
-
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c i2c.c backlight_ps2avrGB.c
-
-# programming options
-PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
-
diff --git a/keyboards/winkeyless/bface/usbconfig.h b/keyboards/winkeyless/bface/usbconfig.h
index f87922615b..5ff26399b0 100644
--- a/keyboards/winkeyless/bface/usbconfig.h
+++ b/keyboards/winkeyless/bface/usbconfig.h
@@ -8,8 +8,7 @@
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/
-#ifndef __usbconfig_h_included__
-#define __usbconfig_h_included__
+#pragma once
#include "config.h"
@@ -109,20 +108,10 @@ section at the end of this file).
* (e.g. HID), but never want to send any data. This option saves a couple
* of bytes in flash memory and the transmit buffers in RAM.
*/
-#define USB_CFG_INTR_POLL_INTERVAL 1
-/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
- * interval. The value is in milliseconds and must not be less than 10 ms for
- * low speed devices.
- */
#define USB_CFG_IS_SELF_POWERED 0
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
* device is powered from the USB bus.
*/
-#define USB_CFG_MAX_BUS_POWER 500
-/* Set this variable to the maximum USB bus power consumption of your device.
- * The value is in milliamperes. [It will be divided by two since USB
- * communicates power requirements in units of 2 mA.]
- */
#define USB_CFG_IMPLEMENT_FN_WRITE 1
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
* transfers. Set it to 0 if you don't need it and want to save a couple of
@@ -238,7 +227,7 @@ section at the end of this file).
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
-#define USB_CFG_DEVICE_VERSION 0x00, 0x02
+#define USB_CFG_DEVICE_VERSION (DEVICE_VER & 0xFF), ((DEVICE_VER >> 8) & 0xFF)
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
@@ -392,5 +381,3 @@ section at the end of this file).
/* #define USB_INTR_PENDING EIFR */
#define USB_INTR_PENDING_BIT INTF1
#define USB_INTR_VECTOR INT1_vect
-
-#endif /* __usbconfig_h_included__ */