incorporating changes from drashna

This commit is contained in:
David Hoelscher 2025-05-07 16:22:21 -05:00
parent 819028dd28
commit e4ae5ef3f2
10 changed files with 26 additions and 24 deletions

View File

@ -111,4 +111,4 @@ bool cmk_cmk6646_housekeeping_task(void) {
update_usb_audio_enable();
// Return value is enabled state of the CM6646
return cm6646_enabled;
}
}

View File

@ -42,4 +42,4 @@ enum cmk_cm6646_keycodes {
void process_record_cmk_cm6646(uint16_t keycode, keyrecord_t *record);
void cmk_cmk6646_init(bool enabled);
bool cmk_cmk6646_housekeeping_task(void);
bool cmk_cmk6646_housekeeping_task(void);

View File

@ -45,4 +45,4 @@
#define MIC_MUTE_CONTROL_PIN A0
#define USB_AUDIO_ENABLE_PIN B6
#define LED_PIN_ON_STATE 0
#define LED_PIN_ON_STATE 0

View File

@ -2,19 +2,19 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include <stdbool.h>
#include "keyboards/custommk/cmk_cm6646.h"
#include "ergosentry_ansi.h"
typedef union {
uint32_t raw;
struct {
bool usb_audio_enabled;
};
} user_config_t;
} keyboard_config_t;
user_config_t user_config;
keyboard_config_t keyboard_config;
void update_kb_eeprom(void) {
eeconfig_update_kb(user_config.raw);
eeconfig_update_kb(keyboard_config.raw);
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
@ -23,29 +23,30 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
}
void keyboard_post_init_kb(void) {
user_config.raw = eeconfig_read_kb();
cmk_cmk6646_init(user_config.usb_audio_enabled);
keyboard_config.raw = eeconfig_read_kb();
cmk_cmk6646_init(keyboard_config.usb_audio_enabled);
keyboard_post_init_user();
}
void housekeeping_task_kb(void) {
bool usb_audio_enabled;
usb_audio_enabled = cmk_cmk6646_housekeeping_task();
if (usb_audio_enabled != user_config.usb_audio_enabled) {
user_config.usb_audio_enabled = usb_audio_enabled;
if (usb_audio_enabled != keyboard_config.usb_audio_enabled) {
keyboard_config.usb_audio_enabled = usb_audio_enabled;
update_kb_eeprom();
}
}
void eeconfig_init_kb() {
void eeconfig_init_kb(void) {
//enable nkro by default (not forced)
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
//enable audio by default (not forced)
user_config.raw = eeconfig_read_kb();
user_config.usb_audio_enabled = 1;
eeconfig_update_kb(user_config.raw);
//enable USB audio by default (not forced)
keyboard_config.raw = eeconfig_read_kb();
keyboard_config.usb_audio_enabled = 1;
eeconfig_update_kb(keyboard_config.raw);
}
eeconfig_init_user();
}

View File

@ -0,0 +1,4 @@
// Copyright 2025 customMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "keyboards/custommk/cmk_cm6646.h"

View File

@ -22,8 +22,6 @@
]
},
"features": {
"command": false,
"console": false,
"audio": true,
"bootmagic": true,
"encoder": true,

View File

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include "cmk_cm6646.h"
#include "ergosentry_ansi.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
@ -21,4 +21,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(RM_PREV, RM_NEXT), ENCODER_CCW_CW(RM_VALD, RM_VALU) }
};
#endif
#endif

View File

@ -1 +1 @@
ENCODER_MAP_ENABLE = yes
ENCODER_MAP_ENABLE = yes

View File

@ -19,4 +19,4 @@
// Used for FRAM
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
#define STM32_SPI_USE_SPI1 TRUE

View File

@ -2,4 +2,3 @@ SRC += matrix.c \
keyboards/custommk/cmk_cm6646.c
CUSTOM_MATRIX = lite
CIE1931_CURVE = yes