From a6e49e0d48fcdb4c42d7bb36c9108ebf927c59a3 Mon Sep 17 00:00:00 2001 From: Kay Hennig Date: Mon, 20 Jun 2022 22:29:56 +0200 Subject: [PATCH] added WeAct BlackPill V3 MCU --- src/const/index.js | 9 ++++++++- src/files/generators/rules.mk.js | 9 +++++++++ src/state/keyboard/index.js | 4 ++++ src/ui/panes/pins/index.js | 3 +++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/const/index.js b/src/const/index.js index 6ad88ae1..39573f80 100644 --- a/src/const/index.js +++ b/src/const/index.js @@ -35,6 +35,7 @@ const C = { CONTROLLER_ATMEGA32U2: 0, CONTROLLER_ATMEGA32U4: 1, CONTROLLER_AT90USB1286: 2, + CONTROLLER_BLACKPILLV3: 3, // Pins. PINS: { @@ -57,7 +58,13 @@ const C = { 'D0', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'E0', 'E1', 'E2', 'E3', 'E4', 'E5', 'E6', 'E7', 'F0', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7' - ] + ], + 3: [ //CONTROLLER_BLACKPILLV3 + 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', + 'A8', 'A15', 'B0', 'B1', 'B3', 'B4', 'B5', 'B6', + 'B7', 'B10', 'B12', 'B13', 'B14', 'B15', 'C13', + 'C14', 'C15' + ] }, // Keycodes. diff --git a/src/files/generators/rules.mk.js b/src/files/generators/rules.mk.js index 214adb2c..a3ab4055 100644 --- a/src/files/generators/rules.mk.js +++ b/src/files/generators/rules.mk.js @@ -14,6 +14,7 @@ class RulesMK extends Generator { case C.CONTROLLER_ATMEGA32U2: mcu = 'atmega32u2'; break; case C.CONTROLLER_ATMEGA32U4: mcu = 'atmega32u4'; break; case C.CONTROLLER_AT90USB1286: mcu = 'at90usb1286'; break; + case C.CONTROLLER_BLACKPILLV3: mcu = 'STM32F411'; break; } let bootloaderSize; @@ -24,6 +25,14 @@ class RulesMK extends Generator { case C.BOOTLOADER_8192: bootloaderSize = '8192'; break; } + if(keyboard.controller == C.CONTROLLER_BLACKPILLV3) + { + return { + 'mcu': mcu, + 'use_backlight': keyboard.pins.led ? 'yes' : 'no', + 'use_rgb': keyboard.pins.rgb ? 'yes' : 'no' + }; + } return { 'mcu': mcu, 'bootloader_size': bootloaderSize, diff --git a/src/state/keyboard/index.js b/src/state/keyboard/index.js index 6bda1a6a..05de191e 100644 --- a/src/state/keyboard/index.js +++ b/src/state/keyboard/index.js @@ -352,6 +352,10 @@ class Keyboard { if (!overlappingPins) { this.errors.push('There are overlapping pins.'); } + if(this._controller == C.CONTROLLER_BLACKPILLV3 && this.pins.row.some(p => (['C13', 'C14', 'C15']).includes(p))) + { + this.errors.push('C13 C14 C15 can not be used as row pins'); + } // Check to see if there are all the recommended keys in the keymap. const inKeymap = new Set(); diff --git a/src/ui/panes/pins/index.js b/src/ui/panes/pins/index.js index fa2dfd88..c45fe979 100644 --- a/src/ui/panes/pins/index.js +++ b/src/ui/panes/pins/index.js @@ -22,6 +22,7 @@ class Pins extends React.Component { + ATmega32U2: Alps64 @@ -29,6 +30,8 @@ class Pins extends React.Component { ATmega32U4: Teensy 2.0, Pro Micro, GH60 (Most Common)
AT90USB1286: Teensy++ 2.0 +
+ BLACKPILLV3: WeAct BlackPill V3.0
Configure the row and column pins.