use CRLF for Focus newlines

Signed-off-by: Taylor Yu <tlyu@mit.edu>
pull/1225/head
Taylor Yu 2 years ago
parent 8f3fab579b
commit cf66803288

@ -54,8 +54,8 @@ EventHandlerResult AutoShiftConfig::onFocusEvent(const char *command) {
CATEGORIES, CATEGORIES,
} subCommand; } subCommand;
if (::Focus.handleHelp(command, PSTR("autoshift.enabled\n" if (::Focus.handleHelp(command, PSTR("autoshift.enabled\r\n"
"autoshift.timeout\n" "autoshift.timeout\r\n"
"autoshift.categories"))) "autoshift.categories")))
return EventHandlerResult::OK; return EventHandlerResult::OK;

@ -215,7 +215,7 @@ EventHandlerResult DynamicMacros::onNameQuery() {
} }
EventHandlerResult DynamicMacros::onFocusEvent(const char *command) { EventHandlerResult DynamicMacros::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("macros.map\nmacros.trigger"))) if (::Focus.handleHelp(command, PSTR("macros.map\r\nmacros.trigger")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("macros."), 7) != 0) if (strncmp_P(command, PSTR("macros."), 7) != 0)

@ -102,7 +102,7 @@ void EEPROMKeymap::dumpKeymap(uint8_t layers, Key (*getkey)(uint8_t, KeyAddr)) {
} }
EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) { EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("keymap.custom\nkeymap.default\nkeymap.onlyCustom"))) if (::Focus.handleHelp(command, PSTR("keymap.custom\r\nkeymap.default\r\nkeymap.onlyCustom")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("keymap."), 7) != 0) if (strncmp_P(command, PSTR("keymap."), 7) != 0)

@ -164,7 +164,7 @@ EventHandlerResult FocusSettingsCommand::onFocusEvent(const char *command) {
GET_CRC, GET_CRC,
} sub_command; } sub_command;
if (::Focus.handleHelp(command, PSTR("settings.defaultLayer\nsettings.valid?\nsettings.version\nsettings.crc"))) if (::Focus.handleHelp(command, PSTR("settings.defaultLayer\r\nsettings.valid?\r\nsettings.version\r\nsettings.crc")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("settings."), 9) != 0) if (strncmp_P(command, PSTR("settings."), 9) != 0)
@ -213,7 +213,7 @@ EventHandlerResult FocusEEPROMCommand::onFocusEvent(const char *command) {
ERASE, ERASE,
} sub_command; } sub_command;
if (::Focus.handleHelp(command, PSTR("eeprom.contents\neeprom.free\neeprom.erase"))) if (::Focus.handleHelp(command, PSTR("eeprom.contents\r\neeprom.free\r\neeprom.erase")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strcmp_P(command, PSTR("eeprom.contents")) == 0) if (strcmp_P(command, PSTR("eeprom.contents")) == 0)

@ -100,7 +100,7 @@ EventHandlerResult FingerPainter::onFocusEvent(const char *command) {
CLEAR, CLEAR,
} sub_command; } sub_command;
if (::Focus.handleHelp(command, PSTR("fingerpainter.toggle\nfingerpainter.clear"))) if (::Focus.handleHelp(command, PSTR("fingerpainter.toggle\r\nfingerpainter.clear")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("fingerpainter."), 14) != 0) if (strncmp_P(command, PSTR("fingerpainter."), 14) != 0)

@ -91,7 +91,7 @@ bool FocusSerial::handleHelp(const char *command,
} }
EventHandlerResult FocusSerial::onFocusEvent(const char *command) { EventHandlerResult FocusSerial::onFocusEvent(const char *command) {
if (handleHelp(command, PSTR("help\ndevice.reset\nplugins"))) if (handleHelp(command, PSTR("help\r\ndevice.reset\r\nplugins")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strcmp_P(command, PSTR("device.reset")) == 0) { if (strcmp_P(command, PSTR("device.reset")) == 0) {

@ -43,7 +43,7 @@ class FocusSerial : public kaleidoscope::Plugin {
EventHandlerResult sendName(const __FlashStringHelper *name) { EventHandlerResult sendName(const __FlashStringHelper *name) {
Runtime.serialPort().print(name); Runtime.serialPort().print(name);
delayAfterPrint(); delayAfterPrint();
Runtime.serialPort().print(NEWLINE); Runtime.serialPort().println();
delayAfterPrint(); delayAfterPrint();
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }

@ -34,7 +34,7 @@ namespace raise {
#endif #endif
EventHandlerResult Focus::onFocusEvent(const char *command) { EventHandlerResult Focus::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("hardware.version\nhardware.side_power\nhardware.side_ver\nhardware.sled_ver\nhardware.sled_current\nhardware.layout\nhardware.joint\nhardware.keyscan\nhardware.crc_errors\nhardware.firmware"))) if (::Focus.handleHelp(command, PSTR("hardware.version\r\nhardware.side_power\r\nhardware.side_ver\r\nhardware.sled_ver\r\nhardware.sled_current\r\nhardware.layout\r\nhardware.joint\r\nhardware.keyscan\r\nhardware.crc_errors\r\nhardware.firmware")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("hardware."), 9) != 0) if (strncmp_P(command, PSTR("hardware."), 9) != 0)
@ -65,7 +65,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("side_ver")) == 0) { if (strcmp_P(command + 9, PSTR("side_ver")) == 0) {
::Focus.send("left:"); ::Focus.send("left:");
::Focus.send(Runtime.device().side.leftVersion()); ::Focus.send(Runtime.device().side.leftVersion());
::Focus.send("\nright:"); ::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightVersion()); ::Focus.send(Runtime.device().side.rightVersion());
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
@ -73,7 +73,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("crc_errors")) == 0) { if (strcmp_P(command + 9, PSTR("crc_errors")) == 0) {
::Focus.send("left:"); ::Focus.send("left:");
::Focus.send(Runtime.device().side.leftCRCErrors()); ::Focus.send(Runtime.device().side.leftCRCErrors());
::Focus.send("\nright:"); ::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightCRCErrors()); ::Focus.send(Runtime.device().side.rightCRCErrors());
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
@ -81,7 +81,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (strcmp_P(command + 9, PSTR("sled_ver")) == 0) { if (strcmp_P(command + 9, PSTR("sled_ver")) == 0) {
::Focus.send("left:"); ::Focus.send("left:");
::Focus.send(Runtime.device().side.leftSLEDVersion()); ::Focus.send(Runtime.device().side.leftSLEDVersion());
::Focus.send("\nright:"); ::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightSLEDVersion()); ::Focus.send(Runtime.device().side.rightSLEDVersion());
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} }
@ -90,7 +90,7 @@ EventHandlerResult Focus::onFocusEvent(const char *command) {
if (::Focus.isEOL()) { if (::Focus.isEOL()) {
::Focus.send("left:"); ::Focus.send("left:");
::Focus.send(Runtime.device().side.leftSLEDCurrent()); ::Focus.send(Runtime.device().side.leftSLEDCurrent());
::Focus.send("\nright:"); ::Focus.send("\r\nright:");
::Focus.send(Runtime.device().side.rightSLEDCurrent()); ::Focus.send(Runtime.device().side.rightSLEDCurrent());
return EventHandlerResult::EVENT_CONSUMED; return EventHandlerResult::EVENT_CONSUMED;
} else { } else {

@ -33,8 +33,8 @@ EventHandlerResult LayerFocus::onNameQuery() {
} }
EventHandlerResult LayerFocus::onFocusEvent(const char *command) { EventHandlerResult LayerFocus::onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("layer.activate\nlayer.deactivate\nlayer.isActive" if (::Focus.handleHelp(command, PSTR("layer.activate\r\nlayer.deactivate\r\nlayer.isActive"
"\nlayer.moveTo\nlayer.state"))) "\r\nlayer.moveTo\r\nlayer.state")))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (strncmp_P(command, PSTR("layer."), 6) != 0) if (strncmp_P(command, PSTR("layer."), 6) != 0)

@ -133,10 +133,10 @@ EventHandlerResult TypingBreaks::onSetup() {
} }
#define FOCUS_HOOK_TYPINGBREAKS FOCUS_HOOK(TypingBreaks.focusHook, \ #define FOCUS_HOOK_TYPINGBREAKS FOCUS_HOOK(TypingBreaks.focusHook, \
"typingbreaks.idleTimeLimit\n" \ "typingbreaks.idleTimeLimit\r\n" \
"typingbreaks.lockTimeOut\n" \ "typingbreaks.lockTimeOut\r\n" \
"typingbreaks.lockLength\n" \ "typingbreaks.lockLength\r\n" \
"typingbreaks.leftMaxKeys\n" \ "typingbreaks.leftMaxKeys\r\n" \
"typingbreaks.rightMaxKeys") "typingbreaks.rightMaxKeys")
EventHandlerResult TypingBreaks::onFocusEvent(const char *command) { EventHandlerResult TypingBreaks::onFocusEvent(const char *command) {
@ -148,10 +148,10 @@ EventHandlerResult TypingBreaks::onFocusEvent(const char *command) {
RIGHT_MAX, RIGHT_MAX,
} subCommand; } subCommand;
if (::Focus.handleHelp(command, PSTR("typingbreaks.idleTimeLimit\n" if (::Focus.handleHelp(command, PSTR("typingbreaks.idleTimeLimit\r\n"
"typingbreaks.lockTimeOut\n" "typingbreaks.lockTimeOut\r\n"
"typingbreaks.lockLength\n" "typingbreaks.lockLength\r\n"
"typingbreaks.leftMaxKeys\n" "typingbreaks.leftMaxKeys\r\n"
"typingbreaks.rightMaxKeys"))) "typingbreaks.rightMaxKeys")))
return EventHandlerResult::OK; return EventHandlerResult::OK;

@ -224,10 +224,10 @@ EventHandlerResult FocusLEDCommand::onFocusEvent(const char *command) {
if (!Runtime.has_leds) if (!Runtime.has_leds)
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (::Focus.handleHelp(command, PSTR("led.at\n" if (::Focus.handleHelp(command, PSTR("led.at\r\n"
"led.setAll\n" "led.setAll\r\n"
"led.mode\n" "led.mode\r\n"
"led.brightness\n" "led.brightness\r\n"
"led.theme"))) "led.theme")))
return EventHandlerResult::OK; return EventHandlerResult::OK;

Loading…
Cancel
Save