-
-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify matrix for split common and regular matrix #13330
Conversation
6da9c35
to
87a3237
Compare
409bef8
to
5b97ac5
Compare
5b97ac5
to
1e2119a
Compare
To my liking, it would be better to move the definition of |
I'm all for doing this, but a quick look, there are a few other things that could also be moved out. I think I'd rather get this in, and then work on separating out more of the split specific stuff (such as the init code, etc) |
e64a9e4
to
2f08f5d
Compare
I find the following code to be a bit easier to read. #ifdef DIRECT_PINS_RIGHT
# define SPLIT_MUTABLE
#else
# define SPLIT_MUTABLE const
#endif
#ifdef MATRIX_ROW_PINS_RIGHT
# define SPLIT_MUTABLE_ROW
#else
# define SPLIT_MUTABLE_ROW const
#endif
#ifdef MATRIX_COL_PINS_RIGHT
# define SPLIT_MUTABLE_COL
#else
# define SPLIT_MUTABLE_COL const
#endif
#ifdef DIRECT_PINS
static SPLIT_MUTABLE pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
# ifdef MATRIX_ROW_PINS
static SPLIT_MUTABLE_ROW pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
# endif // MATRIX_ROW_PINS
# ifdef MATRIX_COL_PINS
static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
# endif // MATRIX_COL_PINS
#endif |
It's definitely a lot more concise, and I believe that tzarc mentioned doing something similar. Applied. |
@mtei |
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 7b6954e54..ed4643f81 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -22,8 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "debounce.h"
#include "quantum.h"
#ifdef SPLIT_KEYBOARD
-# include "split_util.h"
-# include "transactions.h"
+# include "split_common/split_util.h"
+# include "split_common/transactions.h"
# ifndef ERROR_DISCONNECT_COUNT
# define ERROR_DISCONNECT_COUNT 5 So you don't need to modify the files under See the URL below for the behavior of the C preprocessor |
thanks for the info and correction, @mtei! I've reverted the commit and replaced it with this. |
1586236
to
c47d3b6
Compare
And now I'll see about pulling out more of the split code from the matrix, as well. |
Description
This merges the split matrix.c with the regular matrix.c, since the files are nearly identical anyways. This will make management of the matrix code simpler, in theory, as there will only be one source of truth for matrix scanning (aside from custom matrices).
Tested on a corne, and verified that it does work properly.
Types of Changes
Issues Fixed or Closed by This PR
Checklist