refinemts: OLED is working better, but new problems.

Now the OLED display is no longer scrambled, but there are two new problems with it:

 1. The number "506" is printed over the design
 2. The screen never refreshes. As originally submitted, the OLED
    would update to reflect layer changes.
This commit is contained in:
Mark Stosberg 2024-06-20 21:46:10 -04:00
parent a4ba098668
commit c7c04c1ce5
No known key found for this signature in database
4 changed files with 56 additions and 43 deletions

View File

@ -128,50 +128,51 @@ report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report) {
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
// xprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
if (!process_record_user(keycode, record)) return false;
switch (keycode) {
if (keycode == CPI_SW && record->event.pressed) {
cocot_config.cpi_idx = (cocot_config.cpi_idx + 1) % CPI_OPTION_SIZE;
eeconfig_update_kb(cocot_config.raw);
pointing_device_set_cpi(cpi_array[cocot_config.cpi_idx]);
}
if (keycode == SCRL_SW && record->event.pressed) {
cocot_config.scrl_div = (cocot_config.scrl_div + 1) % SCRL_DIV_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_R15 && record->event.pressed) {
cocot_config.rotation_angle = (cocot_config.rotation_angle + 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_L15 && record->event.pressed) {
cocot_config.rotation_angle = (ANGLE_SIZE + cocot_config.rotation_angle - 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_IN && record->event.pressed) {
cocot_config.scrl_inv = -cocot_config.scrl_inv;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_TO && record->event.pressed) {
{
cocot_config.scrl_mode ^= 1;
}
}
if (keycode == SCRL_MO) {
{
cocot_config.scrl_mode ^= 1;
}
}
return true;
if (!process_record_user(keycode, record)) {
return false;
}
if (keycode == CPI_SW && record->event.pressed) {
cocot_config.cpi_idx = (cocot_config.cpi_idx + 1) % CPI_OPTION_SIZE;
eeconfig_update_kb(cocot_config.raw);
pointing_device_set_cpi(cpi_array[cocot_config.cpi_idx]);
}
if (keycode == SCRL_SW && record->event.pressed) {
cocot_config.scrl_div = (cocot_config.scrl_div + 1) % SCRL_DIV_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_R15 && record->event.pressed) {
cocot_config.rotation_angle = (cocot_config.rotation_angle + 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == ROT_L15 && record->event.pressed) {
cocot_config.rotation_angle = (ANGLE_SIZE + cocot_config.rotation_angle - 1) % ANGLE_SIZE;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_IN && record->event.pressed) {
cocot_config.scrl_inv = -cocot_config.scrl_inv;
eeconfig_update_kb(cocot_config.raw);
}
if (keycode == SCRL_TO && record->event.pressed) {
{
cocot_config.scrl_mode ^= 1;
}
}
if (keycode == SCRL_MO) {
{
cocot_config.scrl_mode ^= 1;
}
}
return true;
}
void eeconfig_init_kb(void) {
cocot_config.cpi_idx = COCOT_CPI_DEFAULT;
cocot_config.scrl_div = COCOT_SCROLL_DIV_DEFAULT;

View File

@ -14,7 +14,7 @@
},
"features": {
"bootmagic": true,
"encoder":true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"oled": true,

View File

@ -94,23 +94,33 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case _LOWER:
#ifdef RGBLIGHT_ENABLE
rgblight_sethsv_range(HSV_BLUE, 0, 2);
#endif
cocot_set_scroll_mode(true);
break;
case _RAISE:
#ifdef RGBLIGHT_ENABLE
rgblight_sethsv_range(HSV_RED, 0, 2);
#endif
cocot_set_scroll_mode(true);
break;
case _TRACKBALL:
#ifdef RGBLIGHT_ENABLE
rgblight_sethsv_range(HSV_GREEN, 0, 2);
#endif
cocot_set_scroll_mode(false);
break;
default:
#ifdef RGBLIGHT_ENABLE
rgblight_sethsv_range( 0, 0, 0, 0, 2);
#endif
cocot_set_scroll_mode(false);
break;
}
#ifdef RGBLIGHT_ENABLE
rgblight_set_effect_range( 2, 10);
#endif
return state;
};

View File

@ -1,3 +1,5 @@
SRC += matrix.c
CUSTOM_MATRIX = lite
POINTING_DEVICE_DRIVER = adns5050
# NO room in firmware
SPACE_CADET_ENABLE = no