From 2f3147361adabe8f5e115ab0304f1481393e62f3 Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Wed, 27 Oct 2021 01:00:44 +0100 Subject: [PATCH] Fix console support not working --- platformio.ini | 8 +++++++- src/main.cpp | 2 +- src/modes/DefaultKeyboardMode.cpp | 12 ++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/platformio.ini b/platformio.ini index e8ad1116..a4d33b64 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,6 +10,12 @@ [env] lib_ldf_mode = chain+ +build_flags = + -Os + -fdata-sections + -ffunction-sections + -Wl,--gc-sections + -Wl,--print-gc-sections [common] default_src_filter = @@ -88,4 +94,4 @@ board = megaatmega2560 extends = env:mega src_build_flags = -DSMASHBOX - -DNOUSB \ No newline at end of file + -DNOUSB diff --git a/src/main.cpp b/src/main.cpp index 950a2a5e..d1706fd9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -125,7 +125,7 @@ void loop() { selectInputMode(); // Only run input viewer on every 3 updates, to prevent lag. - if (Serial && Serial.availableForWrite() > 32) { + if (Serial.availableForWrite() > 32) { if (gReportClock == 0) { writeSerialReport(); gReportClock++; diff --git a/src/modes/DefaultKeyboardMode.cpp b/src/modes/DefaultKeyboardMode.cpp index e5ad18dd..d44618c2 100644 --- a/src/modes/DefaultKeyboardMode.cpp +++ b/src/modes/DefaultKeyboardMode.cpp @@ -5,15 +5,15 @@ DefaultKeyboardMode::DefaultKeyboardMode(socd::SocdType socdType, : KeyboardMode(socdType, rInputState) {} void DefaultKeyboardMode::SendKeys() { - Press('q', mrInputState.l); - Press('3', mrInputState.left); - Press('4', mrInputState.down); - Press('5', mrInputState.right); + Press('a', mrInputState.l); + Press('b', mrInputState.left); + Press('c', mrInputState.down); + Press('d', mrInputState.right); Press('e', mrInputState.mod_x); Press('f', mrInputState.mod_y); - //Press('g', mrInputState.select); + Press('g', mrInputState.select); Press('h', mrInputState.start); - //Press('i', mrInputState.home); + Press('i', mrInputState.home); Press('j', mrInputState.r); Press('k', mrInputState.y); Press('l', mrInputState.lightshield);