summaryrefslogtreecommitdiffstats
path: root/keyboards/dtisaac/dosa40rgb/keymaps
diff options
context:
space:
mode:
authorDao Tak Isaac <daotran0940@gmail.com>2021-10-10 04:55:00 +0700
committerGitHub <noreply@github.com>2021-10-09 14:55:00 -0700
commit3c188d98a1aebbabb06c635f91195182aa84fa4d (patch)
tree28a275049db66af04b68dddb375e32ac6f3eb66c /keyboards/dtisaac/dosa40rgb/keymaps
parentf216c20fc74fc1b8ef2e6d952b17b1ee1914e236 (diff)
[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
Diffstat (limited to 'keyboards/dtisaac/dosa40rgb/keymaps')
-rw-r--r--keyboards/dtisaac/dosa40rgb/keymaps/default/keymap.c55
1 files changed, 1 insertions, 54 deletions
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 <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(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