summaryrefslogtreecommitdiffstats
path: root/keyboards/helix
diff options
context:
space:
mode:
authorTakeshi ISHII <2170248+mtei@users.noreply.github.com>2018-11-06 21:02:30 +0100
committerDrashna Jaelre <drashna@live.com>2018-11-06 21:02:30 +0100
commita91f439aec39ec8bbcbb2f579a9434c266f09f5c (patch)
treea2cbe921ccd0db55678059fb993d83c1881e1fc5 /keyboards/helix
parent8f5ac39fb90e9036a9df60f286888e02daf3fd1b (diff)
downloadqmk_firmware-a91f439aec39ec8bbcbb2f579a9434c266f09f5c.tar.gz
qmk_firmware-a91f439aec39ec8bbcbb2f579a9434c266f09f5c.tar.xz
Helix-serial.c configuration improvement (#4370)
The new simple API can be selected. Previous version, can select two way. * use old API (compatible with let's split serial.c) * use new API (multi-type transaction) This version, can select three way. * use old API (compatible with let's split serial.c) * use new API (single-type transaction) * use new API (multi-type transaction) There is no change in the code generated by this change.
Diffstat (limited to 'keyboards/helix')
-rw-r--r--keyboards/helix/serial.c6
-rw-r--r--keyboards/helix/serial.h35
2 files changed, 23 insertions, 18 deletions
diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c
index 325c29a3f..6006ebf1b 100644
--- a/keyboards/helix/serial.c
+++ b/keyboards/helix/serial.c
@@ -71,8 +71,8 @@
#endif
//////////////// for backward compatibility ////////////////////////////////
-#ifndef SERIAL_USE_MULTI_TRANSACTION
-/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
+#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION)
+/* --- USE OLD API (compatible with let's split serial.c) */
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
#endif
@@ -112,7 +112,7 @@ int serial_update_buffers()
return result;
}
-#endif // end of Simple API (OLD API, compatible with let's split serial.c)
+#endif // end of OLD API (compatible with let's split serial.c)
////////////////////////////////////////////////////////////////////////////
#define ALWAYS_INLINE __attribute__((always_inline))
diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h
index 7e0c0847a..2e53928df 100644
--- a/keyboards/helix/serial.h
+++ b/keyboards/helix/serial.h
@@ -15,31 +15,36 @@
// // 4: about 26kbps
// // 5: about 20kbps
//
-// //// USE Simple API (OLD API, compatible with let's split serial.c)
+// //// USE OLD API (compatible with let's split serial.c)
// ex.
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
// #define SERIAL_MASTER_BUFFER_LENGTH 1
//
-// //// USE flexible API (using multi-type transaction function)
-// #define SERIAL_USE_MULTI_TRANSACTION
+// //// USE NEW API
+// //// USE simple API (using signle-type transaction function)
+// #define SERIAL_USE_SINGLE_TRANSACTION
+// //// USE flexible API (using multi-type transaction function)
+// #define SERIAL_USE_MULTI_TRANSACTION
//
// /////////////////////////////////////////////////////////////////
-#ifndef SERIAL_USE_MULTI_TRANSACTION
-/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
-#if SERIAL_SLAVE_BUFFER_LENGTH > 0
-extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
-#endif
-#if SERIAL_MASTER_BUFFER_LENGTH > 0
-extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
-#endif
+//////////////// for backward compatibility ////////////////////////////////
+#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION)
+/* --- USE OLD API (compatible with let's split serial.c) */
+ #if SERIAL_SLAVE_BUFFER_LENGTH > 0
+ extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
+ #endif
+ #if SERIAL_MASTER_BUFFER_LENGTH > 0
+ extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
+ #endif
-void serial_master_init(void);
-void serial_slave_init(void);
-int serial_update_buffers(void);
+ void serial_master_init(void);
+ void serial_slave_init(void);
+ int serial_update_buffers(void);
-#endif // USE Simple API
+#endif // end of USE OLD API
+////////////////////////////////////////////////////////////////////////////
// Soft Serial Transaction Descriptor
typedef struct _SSTD_t {