]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Helix config refine (#3374)
authorMakotoKurauchi <pluis@me.com>
Thu, 12 Jul 2018 17:23:30 +0000 (02:23 +0900)
committerDrashna Jaelre <drashna@live.com>
Thu, 12 Jul 2018 17:23:30 +0000 (10:23 -0700)
* helix config.h refine

19 files changed:
keyboards/helix/config.h
keyboards/helix/rev1/config.h
keyboards/helix/rev1/keymaps/OLED_sample/config.h
keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h [new file with mode: 0644]
keyboards/helix/rev1/keymaps/default/config.h
keyboards/helix/rev1/serial_config.h [new file with mode: 0644]
keyboards/helix/rev2/config.h
keyboards/helix/rev2/keymaps/default/config.h
keyboards/helix/rev2/keymaps/edvorakjp/config.h
keyboards/helix/rev2/keymaps/five_rows/config.h
keyboards/helix/rev2/keymaps/five_rows_jis/config.h
keyboards/helix/rev2/keymaps/froggy/config.h
keyboards/helix/rev2/keymaps/led_test/config.h
keyboards/helix/rev2/matrix.c
keyboards/helix/rev2/serial_config.h [new file with mode: 0644]
keyboards/helix/rev2/split_util.c
keyboards/helix/serial.c
keyboards/helix/serial.h
keyboards/helix/ssd1306.h

index 8f0524f97262e8f641fcf6507ca6acd563a5f1f2..7bd4d2645687a671bb56ff45e9d77a87cc67dc31 100644 (file)
@@ -21,8 +21,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #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 <serial_config.h>
+
+// 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 */
index 3420992d83d452155a5bb4501f584ecf154a88ad..7fec62fc83d7dd7f1b81eb47578b8f42152ddce6 100644 (file)
@@ -19,8 +19,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef REV1_CONFIG_H
 #define REV1_CONFIG_H
 
-#include "../config.h"
-
 /* USB Device descriptor parameter */
 #define VENDOR_ID       0xFEED
 #define PRODUCT_ID      0x3060
index 6cd3072b14caae5f76e2e54df4bb206d64c6bbb4..0e1b787a5aa425df5c44ec6de2562c4d80e35e3c 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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 <http://www.gnu.org/licenses/>.
 
 #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 (file)
index 0000000..be2e7cb
--- /dev/null
@@ -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 */
index 7f33a43630aaf7d722fca4a09939869b4a01d23e..d95925d4e45a50cf25f55ace29ca62153bfcb829 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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 <http://www.gnu.org/licenses/>.
 // #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 (file)
index 0000000..2b668a6
--- /dev/null
@@ -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 */
index 5307578832de5101c3a5dc4b0380f493d0b0ba80..058236122ffcbdc94512049ebfe2284d85d7ec1d 100644 (file)
@@ -19,8 +19,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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 <http://www.gnu.org/licenses/>.
 /* Use I2C or Serial */
 #define USE_I2C
 #define USE_SERIAL
-#define USE_SERIAL_PD2
 //#define USE_MATRIX_I2C
 
 /* Select hand configuration */
index 0e7967c73b998f44d4cc715431d68cf5b1dc6f41..6da6849a1d2692e8ee8045317d4f466d504898fc 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef CONFIG_USER_H
 #define CONFIG_USER_H
 
-#include "../../config.h"
-
 // place overrides here
 
 #endif /* CONFIG_USER_H */
index bb569ca5df56bc1c495c655dfd1a49d9f73f7d9a..a7a5f8360006cf92520dafc89f62868ecdeaac11 100644 (file)
@@ -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
index 0e7967c73b998f44d4cc715431d68cf5b1dc6f41..6da6849a1d2692e8ee8045317d4f466d504898fc 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef CONFIG_USER_H
 #define CONFIG_USER_H
 
-#include "../../config.h"
-
 // place overrides here
 
 #endif /* CONFIG_USER_H */
index 17c4a30b340900f5236fa42d4a1ac4e2defa1e9b..b4390551ef5b12c846314cd80e581bbe8d5999d8 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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 <http://www.gnu.org/licenses/>.
   #error "expected HELIX_ROWS 4 or 5"
 #endif
 
-#define USE_SERIAL_PD2
-
 #define PREVENT_STUCK_MODIFIERS
 #define TAPPING_FORCE_HOLD
 #define TAPPING_TERM 100
index 8161d4a25d4d24fab693a8502a674b1b98bf191c..df72aef123fb22b7fe4eadb06608862d2b359904 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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. */
index 0e7967c73b998f44d4cc715431d68cf5b1dc6f41..6da6849a1d2692e8ee8045317d4f466d504898fc 100644 (file)
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #ifndef CONFIG_USER_H
 #define CONFIG_USER_H
 
-#include "../../config.h"
-
 // place overrides here
 
 #endif /* CONFIG_USER_H */
index a908360c59b01246e0208afa3bccf04d61116189..8a1ce3af1e57081837645880f8fa4e60af2277e3 100644 (file)
@@ -30,7 +30,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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 (file)
index 0000000..82c6e4e
--- /dev/null
@@ -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 */
index 8bc064174ea5563a3bf0e4c6d5cfbbe0811a2b58..beb39fa0059199a21acd8c4be329472f5dbcf107 100644 (file)
@@ -7,7 +7,6 @@
 #include "split_util.h"
 #include "matrix.h"
 #include "keyboard.h"
-#include "config.h"
 
 #ifdef USE_MATRIX_I2C
 #  include "i2c.h"
index 182f222196dc00148ec1730b21be3990db4c0fe3..5919415877891844e433939b6a4905b74644f356 100644 (file)
@@ -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
 }
 
index 8f15d6675337c70316dc373da6266a772e256c1d..c3c9569b2c4aa6757df429279bc6590264165466 100644 (file)
@@ -1,28 +1,19 @@
-#ifndef MY_SERIAL_H
-#define MY_SERIAL_H
+#ifndef SOFT_SERIAL_H
+#define SOFT_SERIAL_H
 
-#include "config.h"
 #include <stdbool.h>
 
-/* 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 */
index b65c505c973cbd2ec90afb705af41aeb938f89b9..77ce7c211a04c7e1d0be820cb8a6ce7c0bf48247 100644 (file)
@@ -4,7 +4,6 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include "pincontrol.h"
-#include "config.h"
 
 enum ssd1306_cmds {
   DisplayOff = 0xAE,