Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Drashna Jael're
2021-10-09 15:31:32 -07:00
12 changed files with 339 additions and 57 deletions

View File

@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
//#define DEBOUNCE 5
/* disable these deprecated features by default */
#define NO_ACTION_MACRO

View File

@@ -14,8 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "spi_master.h"
#include "wait.h"
// Defines names for use in layer keycodes and the keymap
enum layer_names {
@@ -28,14 +26,9 @@ enum layer_names {
enum custom_keycodes {
BASE,
L1,
BLE_DIS, // Disconnect BLE
LED_EN, // Toggle LED
};
#define L1 MO(_L1)
const uint8_t cm1[] = "AT+GAPSTOPADV";
const uint8_t cm2[] = "AT+GAPDISCONNECT";
const uint8_t cm3[] = "ATZ";
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base */
@@ -52,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[_L2] = LAYOUT(
LED_EN, RGB_RMOD, KC_UP, RGB_MOD, RGB_HUI, RGB_VAI, RGB_SAI, RGB_SPI, KC_TRNS, OUT_USB, OUT_BT, BLE_DIS,
RGB_TOG, RGB_RMOD, KC_UP, RGB_MOD, RGB_HUI, RGB_VAI, RGB_SAI, RGB_SPI, KC_TRNS, OUT_USB, OUT_BT, KC_TRNS,
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, RGB_HUD, RGB_VAD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_BSLS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
@@ -74,49 +67,3 @@ void rgb_matrix_indicators_user(void)
rgb_matrix_set_color(22, 200, 0, 200);
}
}
void sdep_send(const uint8_t *cmd, uint8_t len) {
spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, 2);
uint8_t cnt = 200;
bool ready = false;
do {
ready = spi_write(0x10) != 0xFE;
if (ready) {
break;
}
spi_stop();
wait_us(25);
spi_start(ADAFRUIT_BLE_CS_PIN, false, 0, 2);
} while (cnt--);
if (ready) {
spi_write(0x00);
spi_write(0x0A);
spi_write(len);
spi_transmit(cmd, len);
}
spi_stop();
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LED_EN:
if (record->event.pressed) {
DDRB = DDRB ^ 0x20;
PORTB &= ~(1 << 5);
}
return false;
case BLE_DIS:
if (record->event.pressed) {
sdep_send(cm1,sizeof(cm1));
sdep_send(cm2,sizeof(cm2));
sdep_send(cm3,sizeof(cm3));
}
return false;
}
return true;
}

View File

@@ -19,7 +19,8 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to
## Bootloader
Enter the bootloader in 2 ways:
Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `RESET` if it is available

View File

@@ -7,7 +7,7 @@ BOOTLOADER = lufa-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = no # Audio control and System control
CONSOLE_ENABLE = no # Console for debug