|
|
@ -164,9 +164,6 @@ static bool command_common(uint8_t code)
|
|
|
|
debug_enable = false;
|
|
|
|
debug_enable = false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
print("\nDEBUG: enabled.\n");
|
|
|
|
print("\nDEBUG: enabled.\n");
|
|
|
|
debug_matrix = true;
|
|
|
|
|
|
|
|
debug_keyboard = true;
|
|
|
|
|
|
|
|
debug_mouse = true;
|
|
|
|
|
|
|
|
debug_enable = true;
|
|
|
|
debug_enable = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -205,7 +202,7 @@ static bool command_common(uint8_t code)
|
|
|
|
print("VERSION: " STR(DEVICE_VER) "\n");
|
|
|
|
print("VERSION: " STR(DEVICE_VER) "\n");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case KC_T: // print timer
|
|
|
|
case KC_T: // print timer
|
|
|
|
print("timer: "); phex16(timer_count>>16); phex16(timer_count); print("\n");
|
|
|
|
print_val_hex32(timer_count);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case KC_P: // print toggle
|
|
|
|
case KC_P: // print toggle
|
|
|
|
if (print_enable) {
|
|
|
|
if (print_enable) {
|
|
|
@ -218,20 +215,20 @@ static bool command_common(uint8_t code)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case KC_S:
|
|
|
|
case KC_S:
|
|
|
|
print("\n\n----- Status -----\n");
|
|
|
|
print("\n\n----- Status -----\n");
|
|
|
|
print("host_keyboard_leds:"); phex(host_keyboard_leds()); print("\n");
|
|
|
|
print_val_hex8(host_keyboard_leds());
|
|
|
|
#ifdef HOST_PJRC
|
|
|
|
#ifdef HOST_PJRC
|
|
|
|
print("UDCON: "); phex(UDCON); print("\n");
|
|
|
|
print_val_hex8(UDCON);
|
|
|
|
print("UDIEN: "); phex(UDIEN); print("\n");
|
|
|
|
print_val_hex8(UDIEN);
|
|
|
|
print("UDINT: "); phex(UDINT); print("\n");
|
|
|
|
print_val_hex8(UDINT);
|
|
|
|
print("usb_keyboard_leds:"); phex(usb_keyboard_leds); print("\n");
|
|
|
|
print_val_hex8(usb_keyboard_leds);
|
|
|
|
print("usb_keyboard_protocol: "); phex(usb_keyboard_protocol); print("\n");
|
|
|
|
print_val_hex8(usb_keyboard_protocol);
|
|
|
|
print("usb_keyboard_idle_config:"); phex(usb_keyboard_idle_config); print("\n");
|
|
|
|
print_val_hex8(usb_keyboard_idle_config);
|
|
|
|
print("usb_keyboard_idle_count:"); phex(usb_keyboard_idle_count); print("\n");
|
|
|
|
print_val_hex8(usb_keyboard_idle_count);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HOST_VUSB
|
|
|
|
#ifdef HOST_VUSB
|
|
|
|
# if USB_COUNT_SOF
|
|
|
|
# if USB_COUNT_SOF
|
|
|
|
print("usbSofCount: "); phex(usbSofCount); print("\n");
|
|
|
|
print_val_hex8(usbSofCount);
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -350,6 +347,7 @@ static void mousekey_param_print(void)
|
|
|
|
print("6: mk_wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n");
|
|
|
|
print("6: mk_wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n");
|
|
|
|
static void mousekey_param_inc(uint8_t param, uint8_t inc)
|
|
|
|
static void mousekey_param_inc(uint8_t param, uint8_t inc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (param) {
|
|
|
|
switch (param) {
|
|
|
@ -358,42 +356,42 @@ static void mousekey_param_inc(uint8_t param, uint8_t inc)
|
|
|
|
mk_delay += inc;
|
|
|
|
mk_delay += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_delay = UINT8_MAX;
|
|
|
|
mk_delay = UINT8_MAX;
|
|
|
|
print("mk_delay = "); pdec(mk_delay); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_delay);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
if (mk_interval + inc < UINT8_MAX)
|
|
|
|
if (mk_interval + inc < UINT8_MAX)
|
|
|
|
mk_interval += inc;
|
|
|
|
mk_interval += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_interval = UINT8_MAX;
|
|
|
|
mk_interval = UINT8_MAX;
|
|
|
|
print("mk_interval = "); pdec(mk_interval); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_interval);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
if (mk_max_speed + inc < UINT8_MAX)
|
|
|
|
if (mk_max_speed + inc < UINT8_MAX)
|
|
|
|
mk_max_speed += inc;
|
|
|
|
mk_max_speed += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_max_speed = UINT8_MAX;
|
|
|
|
mk_max_speed = UINT8_MAX;
|
|
|
|
print("mk_max_speed = "); pdec(mk_max_speed); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_max_speed);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
if (mk_time_to_max + inc < UINT8_MAX)
|
|
|
|
if (mk_time_to_max + inc < UINT8_MAX)
|
|
|
|
mk_time_to_max += inc;
|
|
|
|
mk_time_to_max += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_time_to_max = UINT8_MAX;
|
|
|
|
mk_time_to_max = UINT8_MAX;
|
|
|
|
print("mk_time_to_max = "); pdec(mk_time_to_max); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_time_to_max);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 5:
|
|
|
|
if (mk_wheel_max_speed + inc < UINT8_MAX)
|
|
|
|
if (mk_wheel_max_speed + inc < UINT8_MAX)
|
|
|
|
mk_wheel_max_speed += inc;
|
|
|
|
mk_wheel_max_speed += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_wheel_max_speed = UINT8_MAX;
|
|
|
|
mk_wheel_max_speed = UINT8_MAX;
|
|
|
|
print("mk_wheel_max_speed = "); pdec(mk_wheel_max_speed); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_wheel_max_speed);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
case 6:
|
|
|
|
if (mk_wheel_time_to_max + inc < UINT8_MAX)
|
|
|
|
if (mk_wheel_time_to_max + inc < UINT8_MAX)
|
|
|
|
mk_wheel_time_to_max += inc;
|
|
|
|
mk_wheel_time_to_max += inc;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_wheel_time_to_max = UINT8_MAX;
|
|
|
|
mk_wheel_time_to_max = UINT8_MAX;
|
|
|
|
print("mk_wheel_time_to_max = "); pdec(mk_wheel_time_to_max); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_wheel_time_to_max);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -406,42 +404,42 @@ static void mousekey_param_dec(uint8_t param, uint8_t dec)
|
|
|
|
mk_delay -= dec;
|
|
|
|
mk_delay -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_delay = 0;
|
|
|
|
mk_delay = 0;
|
|
|
|
print("mk_delay = "); pdec(mk_delay); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_delay);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 2:
|
|
|
|
if (mk_interval > dec)
|
|
|
|
if (mk_interval > dec)
|
|
|
|
mk_interval -= dec;
|
|
|
|
mk_interval -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_interval = 0;
|
|
|
|
mk_interval = 0;
|
|
|
|
print("mk_interval = "); pdec(mk_interval); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_interval);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
if (mk_max_speed > dec)
|
|
|
|
if (mk_max_speed > dec)
|
|
|
|
mk_max_speed -= dec;
|
|
|
|
mk_max_speed -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_max_speed = 0;
|
|
|
|
mk_max_speed = 0;
|
|
|
|
print("mk_max_speed = "); pdec(mk_max_speed); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_max_speed);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 4:
|
|
|
|
if (mk_time_to_max > dec)
|
|
|
|
if (mk_time_to_max > dec)
|
|
|
|
mk_time_to_max -= dec;
|
|
|
|
mk_time_to_max -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_time_to_max = 0;
|
|
|
|
mk_time_to_max = 0;
|
|
|
|
print("mk_time_to_max = "); pdec(mk_time_to_max); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_time_to_max);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 5:
|
|
|
|
if (mk_wheel_max_speed > dec)
|
|
|
|
if (mk_wheel_max_speed > dec)
|
|
|
|
mk_wheel_max_speed -= dec;
|
|
|
|
mk_wheel_max_speed -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_wheel_max_speed = 0;
|
|
|
|
mk_wheel_max_speed = 0;
|
|
|
|
print("mk_wheel_max_speed = "); pdec(mk_wheel_max_speed); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_wheel_max_speed);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
case 6:
|
|
|
|
if (mk_wheel_time_to_max > dec)
|
|
|
|
if (mk_wheel_time_to_max > dec)
|
|
|
|
mk_wheel_time_to_max -= dec;
|
|
|
|
mk_wheel_time_to_max -= dec;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
mk_wheel_time_to_max = 0;
|
|
|
|
mk_wheel_time_to_max = 0;
|
|
|
|
print("mk_wheel_time_to_max = "); pdec(mk_wheel_time_to_max); print("\n");
|
|
|
|
PRINT_SET_VAL(mk_wheel_time_to_max);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -551,11 +549,11 @@ static uint8_t numkey2num(uint8_t code)
|
|
|
|
|
|
|
|
|
|
|
|
static void switch_layer(uint8_t layer)
|
|
|
|
static void switch_layer(uint8_t layer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
print("current_layer: "); phex(current_layer); print("\n");
|
|
|
|
print_val_hex8(current_layer);
|
|
|
|
print("default_layer: "); phex(default_layer); print("\n");
|
|
|
|
print_val_hex8(default_layer);
|
|
|
|
current_layer = layer;
|
|
|
|
current_layer = layer;
|
|
|
|
default_layer = layer;
|
|
|
|
default_layer = layer;
|
|
|
|
print("switch to Layer: "); phex(layer); print("\n");
|
|
|
|
print("switch to "); print_val_hex8(layer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void clear_keyboard(void)
|
|
|
|
static void clear_keyboard(void)
|
|
|
|