2018-10-11 22:26:56 +00:00
|
|
|
#include QMK_KEYBOARD_H
|
2021-12-15 11:00:39 +00:00
|
|
|
#include "uart.h"
|
2018-10-11 22:26:56 +00:00
|
|
|
|
|
|
|
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");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x01);
|
2018-10-11 22:26:56 +00:00
|
|
|
break;
|
|
|
|
case KC_HOME:
|
|
|
|
sun_bell = !sun_bell;
|
|
|
|
if (sun_bell) {
|
|
|
|
print("Bell On\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x02);
|
2018-10-11 22:26:56 +00:00
|
|
|
} else {
|
|
|
|
print("Bell Off\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x03);
|
2018-10-11 22:26:56 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KC_END:
|
|
|
|
sun_click = !sun_click;
|
|
|
|
if (sun_click) {
|
|
|
|
print("Click On\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x0A);
|
2018-10-11 22:26:56 +00:00
|
|
|
} else {
|
|
|
|
print("Click Off\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x0B);
|
2018-10-11 22:26:56 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case KC_PGUP:
|
|
|
|
print("LED all on\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x0E);
|
|
|
|
uart_write(0xFF);
|
2018-10-11 22:26:56 +00:00
|
|
|
break;
|
|
|
|
case KC_PGDOWN:
|
|
|
|
print("LED all off\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x0E);
|
|
|
|
uart_write(0x00);
|
2018-10-11 22:26:56 +00:00
|
|
|
break;
|
|
|
|
case KC_INSERT:
|
|
|
|
print("layout\n");
|
2021-12-15 11:00:39 +00:00
|
|
|
uart_write(0x0F);
|
2018-10-11 22:26:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xprintf("Unknown extra command: %02X\n", code);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|