mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-28 03:51:15 +00:00
Cle
aning up based on feedback
This commit is contained in:
parent
c93b94ea09
commit
6b81da659d
@ -234,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
|||||||
break;
|
break;
|
||||||
case MSE_INC:
|
case MSE_INC:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT)
|
#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT)
|
||||||
change_pointer_dpi(&global_user_config, true);
|
change_pointer_dpi(&global_user_config, true);
|
||||||
#endif /* ifdef POINTING_DEVICE */
|
#endif /* ifdef POINTING_DEVICE */
|
||||||
debug_config_to_console(&global_user_config);
|
debug_config_to_console(&global_user_config);
|
||||||
@ -252,7 +252,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
|||||||
break;
|
break;
|
||||||
case MSE_TOGG:
|
case MSE_TOGG:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT)
|
#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT)
|
||||||
bool current_state = get_auto_mouse_enable();
|
bool current_state = get_auto_mouse_enable();
|
||||||
set_auto_mouse_enable(!current_state);
|
set_auto_mouse_enable(!current_state);
|
||||||
#endif /* ifdef POINTING_DEVICE */
|
#endif /* ifdef POINTING_DEVICE */
|
||||||
@ -267,52 +267,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OLED_ENABLE
|
|
||||||
|
|
||||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
||||||
if (!is_keyboard_master()) {
|
|
||||||
return OLED_ROTATION_180;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void render_logo(void) {
|
|
||||||
static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00};
|
|
||||||
|
|
||||||
oled_write_P(qmk_logo, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool oled_task_user(void) {
|
|
||||||
render_logo();
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
const char* layer_names[] = {
|
|
||||||
[_BASE] = "BASE CPI: ",
|
|
||||||
[_NUM] = "PROG CPI: ",
|
|
||||||
[_NAV] = "NAVI CPI: ",
|
|
||||||
[_MEDIA] = "MEDIA CPI: ",
|
|
||||||
[_FUNC] = "FUNC CPI: ",
|
|
||||||
[_MOUS] = "MOUSE CPI: ",
|
|
||||||
};
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
char cpi_str[6];
|
|
||||||
uint16_t current_dpi = get_pointer_dpi(&global_user_config);
|
|
||||||
|
|
||||||
snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi);
|
|
||||||
|
|
||||||
oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false);
|
|
||||||
oled_write(cpi_str, false);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif /* ifdef OLED_ENABLE */
|
|
||||||
|
|
||||||
#if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINGINT_DEVICE_LEFT)
|
|
||||||
void pointing_device_init_user(void) {
|
|
||||||
set_auto_mouse_layer(_MOUS);
|
|
||||||
set_auto_mouse_enable(false);
|
|
||||||
}
|
|
||||||
#endif /* ifdef POINTING_DEVICE */
|
|
||||||
|
@ -255,37 +255,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OLED_ENABLE
|
|
||||||
|
|
||||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
||||||
if (!is_keyboard_master()) {
|
|
||||||
return OLED_ROTATION_180;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void render_logo(void) {
|
|
||||||
static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00};
|
|
||||||
|
|
||||||
oled_write_P(qmk_logo, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool oled_task_user(void) {
|
|
||||||
render_logo();
|
|
||||||
|
|
||||||
const char* layer_names[] = {
|
|
||||||
[_BASE] = ">> BASE ", [_NUM] = ">> PROG ", [_NAV] = ">> NAVI ", [_MEDIA] = ">>> MEDIA ", [_FUNC] = ">>> FUNC ", [_MOUS] = ">>> MOUSE ",
|
|
||||||
};
|
|
||||||
|
|
||||||
oled_write_P(PSTR(layer_names[get_highest_layer(layer_state)]), false);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif /* ifdef OLED_ENABLE */
|
|
||||||
|
|
||||||
void pointing_device_init_user(void) {
|
|
||||||
set_auto_mouse_layer(_MOUS);
|
|
||||||
set_auto_mouse_enable(true);
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"keyboard_name": "Crosses 3x6 rev2",
|
||||||
"matrix_pins": {
|
"matrix_pins": {
|
||||||
"cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"],
|
"cols": ["GP1", "GP26", "GP22", "GP21", "GP23", "GP20"],
|
||||||
"rows": ["GP27", "GP28", "GP29", "GP7"]
|
"rows": ["GP27", "GP28", "GP29", "GP7"]
|
||||||
|
@ -173,51 +173,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OLED_ENABLE
|
|
||||||
|
|
||||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
||||||
if (!is_keyboard_master()) {
|
|
||||||
return OLED_ROTATION_180;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void render_logo(void) {
|
|
||||||
static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00};
|
|
||||||
|
|
||||||
oled_write_P(qmk_logo, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool oled_task_user(void) {
|
|
||||||
render_logo();
|
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
const char* layer_names[] = {
|
|
||||||
[_BASE] = "BASE CPI: ",
|
|
||||||
[_NUM] = "PROG CPI: ",
|
|
||||||
[_NAV] = "NAVI CPI: ",
|
|
||||||
[_MEDIA] = "MEDIA CPI: ",
|
|
||||||
[_FUNC] = "FUNC CPI: ",
|
|
||||||
[_MOUS] = "MOUSE CPI: ",
|
|
||||||
[_CUST] = "CUST CPI: ",
|
|
||||||
};
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
char cpi_str[6];
|
|
||||||
uint16_t current_dpi = get_pointer_dpi(&global_user_config);
|
|
||||||
|
|
||||||
snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi);
|
|
||||||
|
|
||||||
oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false);
|
|
||||||
oled_write(cpi_str, false);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif /* ifdef OLED_ENABLE */
|
|
||||||
|
|
||||||
void pointing_device_init_user(void) {
|
|
||||||
set_auto_mouse_layer(_MOUS);
|
|
||||||
set_auto_mouse_enable(true);
|
|
||||||
}
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"keyboard_name": "Crosses 54 Rev2",
|
"keyboard_name": "Crosses 4x6 rev2",
|
||||||
"matrix_pins": {
|
"matrix_pins": {
|
||||||
"cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"],
|
"cols": ["GP13", "GP26", "GP22", "GP21", "GP23", "GP20"],
|
||||||
"rows": ["GP5", "GP27", "GP28", "GP29", "GP7"]
|
"rows": ["GP5", "GP27", "GP28", "GP29", "GP7"]
|
||||||
|
@ -195,7 +195,9 @@ void secondary_sync_handler(uint8_t in_buflen, const void* in_data, uint8_t out_
|
|||||||
}
|
}
|
||||||
|
|
||||||
void housekeeping_task_kb(void) {
|
void housekeeping_task_kb(void) {
|
||||||
if (!is_keyboard_master()) { return; }
|
if (!is_keyboard_master()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static global_user_config_t last_config = {0};
|
static global_user_config_t last_config = {0};
|
||||||
static uint32_t last_sync = 0;
|
static uint32_t last_sync = 0;
|
||||||
@ -208,7 +210,9 @@ void housekeeping_task_kb(void) {
|
|||||||
|
|
||||||
should_sync = (timer_elapsed32(last_sync) > 500);
|
should_sync = (timer_elapsed32(last_sync) > 500);
|
||||||
|
|
||||||
if (!should_sync) { return; }
|
if (!should_sync) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (transaction_rpc_send(CROSSES_SECONDARY_SYNC_ID, sizeof(global_user_config), &global_user_config)) {
|
if (transaction_rpc_send(CROSSES_SECONDARY_SYNC_ID, sizeof(global_user_config), &global_user_config)) {
|
||||||
last_sync = timer_read32();
|
last_sync = timer_read32();
|
||||||
@ -227,3 +231,52 @@ void keyboard_post_init_kb(void) {
|
|||||||
|
|
||||||
keyboard_post_init_user();
|
keyboard_post_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OLED_ENABLE
|
||||||
|
|
||||||
|
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
|
||||||
|
if (!is_keyboard_master()) {
|
||||||
|
return OLED_ROTATION_180;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
# if defined(POINTING_DEVICE_COMBINED) || defined(POINTING_DEVICE_RIGHT) || defined(POINTING_DEVICE_LEFT)
|
||||||
|
void pointing_device_init_kb(void) {
|
||||||
|
set_auto_mouse_layer(_MOUS);
|
||||||
|
set_auto_mouse_enable(false);
|
||||||
|
}
|
||||||
|
# endif /* ifdef POINTING_DEVICE */
|
||||||
|
|
||||||
|
static void render_logo(void) {
|
||||||
|
static const char PROGMEM qmk_logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00};
|
||||||
|
|
||||||
|
oled_write_P(qmk_logo, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_task_kb(void) {
|
||||||
|
render_logo();
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
const char* layer_names[] = {
|
||||||
|
[0] = "BASE CPI: ",
|
||||||
|
[1] = "PROG CPI: ",
|
||||||
|
[2] = "NAVI CPI: ",
|
||||||
|
[3] = "MEDIA CPI: ",
|
||||||
|
[4] = "FUNC CPI: ",
|
||||||
|
[5] = "MOUSE CPI: ",
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
|
char cpi_str[6];
|
||||||
|
uint16_t current_dpi = get_pointer_dpi(&global_user_config);
|
||||||
|
|
||||||
|
snprintf(cpi_str, sizeof(cpi_str), "%u", (unsigned int)current_dpi);
|
||||||
|
|
||||||
|
oled_write(PSTR(layer_names[get_highest_layer(layer_state)]), false);
|
||||||
|
oled_write(cpi_str, false);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif /* ifdef OLED_ENABLE */
|
||||||
|
Loading…
Reference in New Issue
Block a user