From 3c188d98a1aebbabb06c635f91195182aa84fa4d Mon Sep 17 00:00:00 2001 From: Dao Tak Isaac Date: Sun, 10 Oct 2021 04:55:00 +0700 Subject: [Keyboard] Add cg108 keyboard and fix keymap Dosa40rgb (#14753) * Add cg108 keyboard and fix keymap Dosa40rgb * Update keyboards/dtisaac/cg108/readme.md * Update keyboards/dtisaac/dosa40rgb/rules.mk * Update keyboards/dtisaac/cg108/info.json * Update keyboards/dtisaac/cg108/keymaps/default/keymap.c * Update keyboards/dtisaac/cg108/rules.mk * Update keyboards/dtisaac/cg108/rules.mk --- keyboards/dtisaac/dosa40rgb/config.h | 2 +- .../dtisaac/dosa40rgb/keymaps/default/keymap.c | 55 +--------------------- keyboards/dtisaac/dosa40rgb/readme.md | 3 +- keyboards/dtisaac/dosa40rgb/rules.mk | 2 +- 4 files changed, 5 insertions(+), 57 deletions(-) (limited to 'keyboards/dtisaac/dosa40rgb') diff --git a/keyboards/dtisaac/dosa40rgb/config.h b/keyboards/dtisaac/dosa40rgb/config.h index 52891c4aa5..c2d4a17056 100644 --- a/keyboards/dtisaac/dosa40rgb/config.h +++ b/keyboards/dtisaac/dosa40rgb/config.h @@ -66,7 +66,7 @@ along with this program. If not, see . #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 diff --git a/keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c b/keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c index c9bde4bb8d..19fcb7868e 100644 --- a/keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c +++ b/keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c @@ -14,8 +14,6 @@ * along with this program. If not, see . */ #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(AdafruitBleCSPin, 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(AdafruitBleCSPin, 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; -} \ No newline at end of file diff --git a/keyboards/dtisaac/dosa40rgb/readme.md b/keyboards/dtisaac/dosa40rgb/readme.md index 189dc7b9bc..5f288c6b76 100644 --- a/keyboards/dtisaac/dosa40rgb/readme.md +++ b/keyboards/dtisaac/dosa40rgb/readme.md @@ -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 diff --git a/keyboards/dtisaac/dosa40rgb/rules.mk b/keyboards/dtisaac/dosa40rgb/rules.mk index c3ad783fc9..bf7cde9a55 100644 --- a/keyboards/dtisaac/dosa40rgb/rules.mk +++ b/keyboards/dtisaac/dosa40rgb/rules.mk @@ -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 -- cgit v1.2.3