From e9730cbbfd94fbcf792d992e3a1a65ad279b24d6 Mon Sep 17 00:00:00 2001
From: mtei <2170248+mtei@users.noreply.github.com>
Date: Wed, 11 Jul 2018 04:38:17 +0900
Subject: [PATCH 1/3] temporary change, compiling C, C++ and ASM without -g
---
tmk_core/rules.mk | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index b556c4609bf2..a6534ae3b9f1 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -81,7 +81,7 @@ CSTANDARD = -std=gnu99
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-CFLAGS += -g$(DEBUG)
+#CFLAGS += -g$(DEBUG)
CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT)
# add color
@@ -111,7 +111,7 @@ CFLAGS += $(CSTANDARD)
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-CPPFLAGS += -g$(DEBUG)
+#CPPFLAGS += -g$(DEBUG)
CPPFLAGS += $(CPPDEFS)
CPPFLAGS += -O$(OPT)
# to supress "warning: only initialized variables can be placed into program memory area"
@@ -139,7 +139,8 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS += $(ADEFS)
-ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
+#ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
+ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
#---------------- Library Options ----------------
# Minimalistic printf version
From 1e54c0f2490aad6d612d48fb0d18e8d12b2922ee Mon Sep 17 00:00:00 2001
From: mtei <2170248+mtei@users.noreply.github.com>
Date: Wed, 11 Jul 2018 06:01:42 +0900
Subject: [PATCH 2/3] helix config.h refine
---
keyboards/helix/config.h | 22 +++++++++--
keyboards/helix/rev1/config.h | 2 -
.../helix/rev1/keymaps/OLED_sample/config.h | 4 --
.../rev1/keymaps/OLED_sample/serial_config.h | 16 ++++++++
keyboards/helix/rev1/keymaps/default/config.h | 4 +-
keyboards/helix/rev1/serial_config.h | 16 ++++++++
keyboards/helix/rev2/config.h | 3 --
keyboards/helix/rev2/keymaps/default/config.h | 2 -
.../helix/rev2/keymaps/edvorakjp/config.h | 2 -
.../helix/rev2/keymaps/five_rows/config.h | 2 -
.../helix/rev2/keymaps/five_rows_jis/config.h | 4 --
keyboards/helix/rev2/keymaps/froggy/config.h | 2 -
.../helix/rev2/keymaps/led_test/config.h | 2 -
keyboards/helix/rev2/matrix.c | 1 -
keyboards/helix/rev2/serial_config.h | 16 ++++++++
keyboards/helix/rev2/split_util.c | 1 -
keyboards/helix/serial.c | 6 ++-
keyboards/helix/serial.h | 37 +++++++------------
keyboards/helix/ssd1306.h | 1 -
19 files changed, 85 insertions(+), 58 deletions(-)
create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h
create mode 100644 keyboards/helix/rev1/serial_config.h
create mode 100644 keyboards/helix/rev2/serial_config.h
diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h
index 8f0524f97262..7bd4d2645687 100644
--- a/keyboards/helix/config.h
+++ b/keyboards/helix/config.h
@@ -21,8 +21,22 @@ along with this program. If not, see .
#include "config_common.h"
-#ifdef SUBPROJECT_rev1
- #include "rev1/config.h"
-#endif
+// GCC include 'config.h" sequence in qmk_firmware/keyboards/helix/
+// -include keyboards/helix/config.h
+// -include keyboards/helix/rev?/config.h
+// -include keyboards/helix/rev?/keymaps/MAPNAME/config.h
+// XXXX.c
-#endif
+#include
+
+// GCC include search path in qmk_firmare/keyboards/helix/
+// #include "..." search starts here:
+// #include <...> search starts here:
+// keyboards/helix/rev?/keymaps/MAPNAME
+// keyboards/helix
+// keyboards/helix/rev?
+// .
+// ./tmk_core
+// ......
+
+#endif /* CONFIG_H */
diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h
index 3420992d83d4..7fec62fc83d7 100644
--- a/keyboards/helix/rev1/config.h
+++ b/keyboards/helix/rev1/config.h
@@ -19,8 +19,6 @@ along with this program. If not, see .
#ifndef REV1_CONFIG_H
#define REV1_CONFIG_H
-#include "../config.h"
-
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x3060
diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h
index 6cd3072b14ca..0e1b787a5aa4 100644
--- a/keyboards/helix/rev1/keymaps/OLED_sample/config.h
+++ b/keyboards/helix/rev1/keymaps/OLED_sample/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
/* Use I2C or Serial */
#define USE_I2C
@@ -37,8 +35,6 @@ along with this program. If not, see .
#define SSD1306OLED
-#define USE_SERIAL_PD2
-
#define PREVENT_STUCK_MODIFIERS
#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 100
diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h
new file mode 100644
index 000000000000..be2e7cb8b16c
--- /dev/null
+++ b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h
@@ -0,0 +1,16 @@
+#ifndef SOFT_SERIAL_CONFIG_H
+#define SOFT_SERIAL_CONFIG_H
+
+/* Soft Serial defines */
+#define SERIAL_PIN_DDR DDRD
+#define SERIAL_PIN_PORT PORTD
+#define SERIAL_PIN_INPUT PIND
+#define SERIAL_PIN_MASK _BV(PD2)
+#define SERIAL_PIN_INTERRUPT INT2_vect
+
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH 1
+
+//// #error rev1/keymaps/OLED_sample serial config
+
+#endif /* SOFT_SERIAL_CONFIG_H */
diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h
index 7f33a43630aa..d95925d4e45a 100644
--- a/keyboards/helix/rev1/keymaps/default/config.h
+++ b/keyboards/helix/rev1/keymaps/default/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
/* Use I2C or Serial, not both */
#define USE_SERIAL
@@ -34,4 +32,4 @@ along with this program. If not, see .
// #define _MASTER_RIGHT
// #define EE_HANDS
-#endif
\ No newline at end of file
+#endif
diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h
new file mode 100644
index 000000000000..2b668a6afc18
--- /dev/null
+++ b/keyboards/helix/rev1/serial_config.h
@@ -0,0 +1,16 @@
+#ifndef SOFT_SERIAL_CONFIG_H
+#define SOFT_SERIAL_CONFIG_H
+
+/* Soft Serial defines */
+#define SERIAL_PIN_DDR DDRD
+#define SERIAL_PIN_PORT PORTD
+#define SERIAL_PIN_INPUT PIND
+#define SERIAL_PIN_MASK _BV(PD0)
+#define SERIAL_PIN_INTERRUPT INT0_vect
+
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH 1
+
+/// #error rev1 serial config
+
+#endif /* SOFT_SERIAL_CONFIG_H */
diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h
index 5307578832de..058236122ffc 100644
--- a/keyboards/helix/rev2/config.h
+++ b/keyboards/helix/rev2/config.h
@@ -19,8 +19,6 @@ along with this program. If not, see .
#ifndef REV2_CONFIG_H
#define REV2_CONFIG_H
-#include "../config.h"
-
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x3060
@@ -37,7 +35,6 @@ along with this program. If not, see .
/* Use I2C or Serial */
#define USE_I2C
#define USE_SERIAL
-#define USE_SERIAL_PD2
//#define USE_MATRIX_I2C
/* Select hand configuration */
diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h
index 0e7967c73b99..6da6849a1d26 100644
--- a/keyboards/helix/rev2/keymaps/default/config.h
+++ b/keyboards/helix/rev2/keymaps/default/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
// place overrides here
#endif /* CONFIG_USER_H */
diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h
index bb569ca5df56..a7a5f8360006 100644
--- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h
+++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h
@@ -1,8 +1,6 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
#undef TAPPING_FORCE_HOLD
#undef TAPPING_TERM
#define TAPPING_TERM 120
diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h
index 0e7967c73b99..6da6849a1d26 100644
--- a/keyboards/helix/rev2/keymaps/five_rows/config.h
+++ b/keyboards/helix/rev2/keymaps/five_rows/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
// place overrides here
#endif /* CONFIG_USER_H */
diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h
index 17c4a30b3409..b4390551ef5b 100644
--- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h
+++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
/* Use I2C or Serial */
#define USE_I2C
@@ -59,8 +57,6 @@ along with this program. If not, see .
#error "expected HELIX_ROWS 4 or 5"
#endif
-#define USE_SERIAL_PD2
-
#define PREVENT_STUCK_MODIFIERS
#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 100
diff --git a/keyboards/helix/rev2/keymaps/froggy/config.h b/keyboards/helix/rev2/keymaps/froggy/config.h
index 8161d4a25d4d..df72aef123fb 100644
--- a/keyboards/helix/rev2/keymaps/froggy/config.h
+++ b/keyboards/helix/rev2/keymaps/froggy/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
#undef TAPPING_TERM
#define TAPPING_TERM 200
#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
diff --git a/keyboards/helix/rev2/keymaps/led_test/config.h b/keyboards/helix/rev2/keymaps/led_test/config.h
index 0e7967c73b99..6da6849a1d26 100644
--- a/keyboards/helix/rev2/keymaps/led_test/config.h
+++ b/keyboards/helix/rev2/keymaps/led_test/config.h
@@ -21,8 +21,6 @@ along with this program. If not, see .
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
-#include "../../config.h"
-
// place overrides here
#endif /* CONFIG_USER_H */
diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c
index a908360c59b0..8a1ce3af1e57 100644
--- a/keyboards/helix/rev2/matrix.c
+++ b/keyboards/helix/rev2/matrix.c
@@ -30,7 +30,6 @@ along with this program. If not, see .
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
-#include "config.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
diff --git a/keyboards/helix/rev2/serial_config.h b/keyboards/helix/rev2/serial_config.h
new file mode 100644
index 000000000000..82c6e4e836e3
--- /dev/null
+++ b/keyboards/helix/rev2/serial_config.h
@@ -0,0 +1,16 @@
+#ifndef SOFT_SERIAL_CONFIG_H
+#define SOFT_SERIAL_CONFIG_H
+
+/* Soft Serial defines */
+#define SERIAL_PIN_DDR DDRD
+#define SERIAL_PIN_PORT PORTD
+#define SERIAL_PIN_INPUT PIND
+#define SERIAL_PIN_MASK _BV(PD2)
+#define SERIAL_PIN_INTERRUPT INT2_vect
+
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
+
+//// #error rev2 serial config
+
+#endif /* SOFT_SERIAL_CONFIG_H */
diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c
index 8bc064174ea5..beb39fa00591 100644
--- a/keyboards/helix/rev2/split_util.c
+++ b/keyboards/helix/rev2/split_util.c
@@ -7,7 +7,6 @@
#include "split_util.h"
#include "matrix.h"
#include "keyboard.h"
-#include "config.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c
index 182f222196dc..591941587789 100644
--- a/keyboards/helix/serial.c
+++ b/keyboards/helix/serial.c
@@ -110,16 +110,18 @@ void serial_master_init(void) {
void serial_slave_init(void) {
serial_input_with_pullup();
-#ifndef USE_SERIAL_PD2
+#if SERIAL_PIN_MASK == _BV(PD0)
// Enable INT0
EIMSK |= _BV(INT0);
// Trigger on falling edge of INT0
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
-#else
+#elif SERIAL_PIN_MASK == _BV(PD2)
// Enable INT2
EIMSK |= _BV(INT2);
// Trigger on falling edge of INT2
EICRA &= ~(_BV(ISC20) | _BV(ISC21));
+#else
+ #error unknown SERIAL_PIN_MASK value
#endif
}
diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h
index 8f15d6675337..c3c9569b2c4a 100644
--- a/keyboards/helix/serial.h
+++ b/keyboards/helix/serial.h
@@ -1,28 +1,19 @@
-#ifndef MY_SERIAL_H
-#define MY_SERIAL_H
+#ifndef SOFT_SERIAL_H
+#define SOFT_SERIAL_H
-#include "config.h"
#include
-/* TODO: some defines for interrupt setup */
-#define SERIAL_PIN_DDR DDRD
-#define SERIAL_PIN_PORT PORTD
-#define SERIAL_PIN_INPUT PIND
-
-#ifndef USE_SERIAL_PD2
-#define SERIAL_PIN_MASK _BV(PD0)
-#define SERIAL_PIN_INTERRUPT INT0_vect
-#else
-#define SERIAL_PIN_MASK _BV(PD2)
-#define SERIAL_PIN_INTERRUPT INT2_vect
-#endif
-
-#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
-#ifdef KEYBOARD_helix_rev1
-#define SERIAL_MASTER_BUFFER_LENGTH 1
-#else
-#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
-#endif
+// ////////////////////////////////////////////
+// Need Soft Serial defines in serial_config.h
+// ////////////////////////////////////////////
+// ex.
+// #define SERIAL_PIN_DDR DDRD
+// #define SERIAL_PIN_PORT PORTD
+// #define SERIAL_PIN_INPUT PIND
+// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
+// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
+// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
// Buffers for master - slave communication
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
@@ -33,4 +24,4 @@ void serial_slave_init(void);
int serial_update_buffers(void);
bool serial_slave_data_corrupt(void);
-#endif
+#endif /* SOFT_SERIAL_H */
diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h
index b65c505c973c..77ce7c211a04 100644
--- a/keyboards/helix/ssd1306.h
+++ b/keyboards/helix/ssd1306.h
@@ -4,7 +4,6 @@
#include
#include
#include "pincontrol.h"
-#include "config.h"
enum ssd1306_cmds {
DisplayOff = 0xAE,
From 92643bd5f9395629444a63d9a63de4166babea7a Mon Sep 17 00:00:00 2001
From: mtei <2170248+mtei@users.noreply.github.com>
Date: Thu, 12 Jul 2018 00:39:33 +0900
Subject: [PATCH 3/3] Revert "temporary change, compiling C, C++ and ASM
without -g"
This reverts commit e9730cbbfd94fbcf792d992e3a1a65ad279b24d6.
---
tmk_core/rules.mk | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index a6534ae3b9f1..b556c4609bf2 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -81,7 +81,7 @@ CSTANDARD = -std=gnu99
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-#CFLAGS += -g$(DEBUG)
+CFLAGS += -g$(DEBUG)
CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT)
# add color
@@ -111,7 +111,7 @@ CFLAGS += $(CSTANDARD)
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
-#CPPFLAGS += -g$(DEBUG)
+CPPFLAGS += -g$(DEBUG)
CPPFLAGS += $(CPPDEFS)
CPPFLAGS += -O$(OPT)
# to supress "warning: only initialized variables can be placed into program memory area"
@@ -139,8 +139,7 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS += $(ADEFS)
-#ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
-ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100
+ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
#---------------- Library Options ----------------
# Minimalistic printf version