qmk_firmware/keyboards/converter/sun_usb/command_extra.c
Ryan c12268807d
Migrate serial_uart usages to UART driver (#15479)
* Migrate Thermal Printer feature to UART driver

* Migrate 40percentclub UT47 to UART driver

* Migrate Centromere to UART driver

* Migrate Chimera Ergo to UART driver

* Migrate Chimera Let's Split to UART driver

* Migrate Chimera Ortho to UART driver

* Migrate Chimera Ortho Plus to UART driver

* Migrate Comet46 to UART driver

* Migrate Palm USB converter to UART driver

* Migrate Sun USB converter to UART driver

* Migrate Dichotomy to UART driver

* Migrate Honeycomb to UART driver

* Migrate Mitosis to UART driver

* Migrate Redox W to UART driver

* Migrate Uni660 to UART driver

* Migrate Telophase to UART driver
2021-12-15 11:00:39 +00:00

65 lines
1.6 KiB
C

#include QMK_KEYBOARD_H
#include "uart.h"
bool sun_bell = false;
bool sun_click = false;
bool command_extra(uint8_t code)
{
switch (code) {
case KC_H:
case KC_SLASH: /* ? */
print("\n\n----- Sun converter Help -----\n");
print("Home: Toggle Bell\n");
print("End: Toggle Click\n");
print("PgUp: LED all On\n");
print("PgDown: LED all Off\n");
print("Insert: Layout\n");
print("Delete: Reset\n");
return false;
case KC_DEL:
print("Reset\n");
uart_write(0x01);
break;
case KC_HOME:
sun_bell = !sun_bell;
if (sun_bell) {
print("Bell On\n");
uart_write(0x02);
} else {
print("Bell Off\n");
uart_write(0x03);
}
break;
case KC_END:
sun_click = !sun_click;
if (sun_click) {
print("Click On\n");
uart_write(0x0A);
} else {
print("Click Off\n");
uart_write(0x0B);
}
break;
case KC_PGUP:
print("LED all on\n");
uart_write(0x0E);
uart_write(0xFF);
break;
case KC_PGDOWN:
print("LED all off\n");
uart_write(0x0E);
uart_write(0x00);
break;
case KC_INSERT:
print("layout\n");
uart_write(0x0F);
break;
default:
xprintf("Unknown extra command: %02X\n", code);
return false;
}
return true;
}