示例#1
0
void switchBase(void)
{
    ++mode;
    if (BASE_MAX < mode)
        mode = 0;
    eeprom_write(EEPROM_BASE, mode);
    emitBaseName();
}
示例#2
0
static void about(void)
{
    emitString(about_title);

    // REV.
    emitString(about_rev);
    emitKey(getNumKeycode(BOARD_REV_VALUE));
    emitKey(KEY_ENTER);

    // VER.
    emitString(about_ver);
    emitKey(getNumKeycode((APP_VERSION_VALUE >> 8) & 0xf));
    emitKey(KEY_PERIOD);
    emitKey(getNumKeycode((APP_VERSION_VALUE >> 4) & 0xf));
    emitKey(getNumKeycode(APP_VERSION_VALUE & 0xf));
    emitKey(KEY_ENTER);

#ifdef WITH_HOS
    emitString(about_ble);
    emitString(about_rev);
    emitKey(getNumKeycode(HosGetRevision() & 0xf));
    emitKey(KEY_ENTER);

    emitString(about_ver);
    emitKey(getNumKeycode((HosGetVersion() >> 8) & 0xf));
    emitKey(KEY_PERIOD);
    emitKey(getNumKeycode((HosGetVersion() >> 4) & 0xf));
    emitKey(getNumKeycode(HosGetVersion() & 0xf));
    emitKey(KEY_ENTER);

    emitString(about_copyright);

    emitString(about_kvm);
    emitKey(getNumKeycode(CurrentProfile()));
    emitKey(KEY_ENTER);

    if (!isUSBMode()) {
        emitString(about_lesc);
        emitKey(getNumKeycode(HosGetLESC()));
        emitKey(KEY_ENTER);
    }
#else
    emitString(about_copyright);
#endif

    // F2 OS
    emitString(about_f2);
    emitOSName();

    // F3 Layout
    emitString(about_f3);
    emitBaseName();

    // F4 Kana Layout
    emitString(about_f4);
    emitKanaName();

    // F5 Delay
    emitString(about_f5);
    emitDelayName();

    // F6 Modifiers
    emitString(about_f6);
    emitModName();

    // F7 IME
    emitString(about_f7);
    emitIMEName();

    // F8 LED
    emitString(about_f8);
    emitLEDName();

    // F9 Prefix Shift
    emitString(about_f9);
    emitPrefixShift();

#ifdef ENABLE_MOUSE
    emitMouse();
#endif

#ifdef WITH_HOS
    if (!isBusPowered()) {
        uint16_t voltage = HosGetBatteryVoltage();
        uint8_t level = HosGetBatteryLevel();
        if (HOS_BATTERY_VOLTAGE_OFFSET < voltage) {
            emitKey(getNumKeycode(voltage / 100));
            emitKey(KEY_PERIOD);
            voltage %= 100;
            emitKey(getNumKeycode(voltage / 10));
            emitKey(getNumKeycode(voltage % 10));
            emitKey(KEY_V);
            emitKey(KEY_SPACEBAR);
            emitNumber(level);
            emitKey(KEYPAD_PERCENT);
            emitKey(KEY_ENTER);
        }
    }
#endif
}