*/
#include <stdint.h>
#include <stdbool.h>
-#include <util/delay.h>
+#include "wait.h"
#include "keycode.h"
#include "host.h"
#include "keymap.h"
bool command_extra(uint8_t code) __attribute__ ((weak));
bool command_extra(uint8_t code)
{
+ (void)code;
return false;
}
bool command_console_extra(uint8_t code) __attribute__ ((weak));
bool command_console_extra(uint8_t code)
{
+ (void)code;
return false;
}
static bool command_common(uint8_t code)
{
+#ifdef KEYBOARD_LOCK_ENABLE
static host_driver_t *host_driver = 0;
+#endif
+#ifdef SLEEP_LED_ENABLE
+ static bool sleep_led_test = false;
+#endif
switch (code) {
#ifdef SLEEP_LED_ENABLE
case KC_Z:
// test breathing sleep LED
print("Sleep LED test\n");
- sleep_led_toggle();
- led_set(host_keyboard_leds());
+ if (sleep_led_test) {
+ sleep_led_disable();
+ led_set(host_keyboard_leds());
+ } else {
+ sleep_led_enable();
+ }
+ sleep_led_test = !sleep_led_test;
break;
#endif
#ifdef BOOTMAGIC_ENABLE
case KC_PAUSE:
clear_keyboard();
print("\n\nbootloader... ");
- _delay_ms(1000);
+ wait_ms(1000);
bootloader_jump(); // not return
break;
case KC_D:
#ifdef PROTOCOL_VUSB
" VUSB"
#endif
+#ifdef PROTOCOL_CHIBIOS
+ " CHIBIOS"
+#endif
#ifdef BOOTMAGIC_ENABLE
" BOOTMAGIC"
#endif
" " STR(BOOTLOADER_SIZE) "\n");
print("GCC: " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__)
+#if defined(__AVR__)
" AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
" AVR_ARCH: avr" STR(__AVR_ARCH__) "\n");
+#elif defined(__arm__)
+ // TODO
+ );
+#endif
break;
case KC_S:
print("\n\t- Status -\n");
#ifdef NKRO_ENABLE
print_val_hex8(keyboard_nkro);
#endif
- print_val_hex32(timer_count);
+ print_val_hex32(timer_read32());
#ifdef PROTOCOL_PJRC
print_val_hex8(UDCON);
case KC_N:
clear_keyboard(); //Prevents stuck keys.
keyboard_nkro = !keyboard_nkro;
- if (keyboard_nkro)
+ if (keyboard_nkro) {
print("NKRO: on\n");
- else
+ } else {
print("NKRO: off\n");
+ }
break;
#endif
case KC_ESC:
print("?");
return false;
}
- if (mousekey_param)
+ if (mousekey_param) {
xprintf("M%d> ", mousekey_param);
- else
+ } else {
print("M>" );
+ }
return true;
}
#endif