aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/breaking_changes.md4
-rw-r--r--docs/chibios_upgrade_instructions.md56
m---------lib/chibios0
m---------lib/chibios-contrib0
-rw-r--r--quantum/matrix.c18
-rw-r--r--quantum/split_common/matrix.c18
6 files changed, 78 insertions, 18 deletions
diff --git a/docs/breaking_changes.md b/docs/breaking_changes.md
index 3e85a7076..2ad8b5a14 100644
--- a/docs/breaking_changes.md
+++ b/docs/breaking_changes.md
@@ -96,3 +96,7 @@ This happens immediately after the previous `develop` branch is merged.
96 * [ ] Create a PR for `develop` 96 * [ ] Create a PR for `develop`
97 * [ ] Make sure travis comes back clean 97 * [ ] Make sure travis comes back clean
98 * [ ] Merge `develop` PR 98 * [ ] Merge `develop` PR
99
100## Post-merge operations
101
102* (Optional) [update ChibiOS + ChibiOS-Contrib on `develop`](chibios_upgrade_instructions.md) \ No newline at end of file
diff --git a/docs/chibios_upgrade_instructions.md b/docs/chibios_upgrade_instructions.md
new file mode 100644
index 000000000..40c2faafc
--- /dev/null
+++ b/docs/chibios_upgrade_instructions.md
@@ -0,0 +1,56 @@
1# ChibiOS Upgrade Procedure
2
3ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a branch tied to the ChibiOS version in use and should not be mixed with different versions.
4
5## Getting ChibiOS
6
7* `svn` Initialisation:
8 * Only needed to be done once
9 * You might need to separately install `git-svn` package in your OS's package manager
10 * `git svn init --stdlayout --prefix='svn/' http://svn.osdn.net/svnroot/chibios/`
11 * `git remote add qmk git@github.com:qmk/ChibiOS.git`
12* Updating:
13 * `git svn fetch`
14 * First time around this will take several hours
15 * Subsequent updates will be incremental only
16* Tagging example (work out which version first!):
17 * `git tag -a ver20.3.3 -m ver20.3.3 svn/tags/ver20.3.3`
18 * `git push qmk ver20.3.3`
19 * `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN svn/tags/ver20.3.3`
20 * `git push qmk breaking_YYYY_qN`
21
22## Getting ChibiOS-Contrib
23
24* `git` Initialisation:
25 * `git clone git@github.com:qmk/ChibiOS-Contrib`
26 * `git remote add upstream https://github.com/ChibiOS/ChibiOS-Contrib`
27 * `git checkout -b chibios-20.3.x upstream/chibios-20.3.x`
28* Updating:
29 * `git fetch --all --tags --prune`
30 * `git checkout chibios-20.3.x`
31 * `git pull --ff-only`
32 * `git push origin chibios-20.3.x`
33 * `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN chibios-20.3.x`
34 * `git push origin breaking_YYYY_qN`
35
36## Updating submodules
37
38* Update the submodules
39 * `cd $QMK_FIRMWARE`
40 * `git checkout develop`
41 * `git pull --ff-only`
42 * `git checkout -b chibios-version-bump`
43 * `cd lib/chibios`
44 * `git fetch --all --tags --prune`
45 * `git checkout breaking_YYYY_qN`
46 * `cd ../chibios-contrib`
47 * `git fetch --all --tags --prune`
48 * `git checkout breaking_YYYY_qN`
49* Build everything
50 * `cd $QMK_FIRMWARE`
51 * `qmk multibuild -j4`
52 * Make sure there are no errors
53* Push to the repo
54 * `git commit -am 'Update ChibiOS to XXXXXXXXX'`
55 * `git push --set-upstream origin chibios-version-bump`
56* Make a PR to qmk_firmware with the new branch \ No newline at end of file
diff --git a/lib/chibios b/lib/chibios
Subproject ffe54d63cb10a355add318f8e922e39f1c3d4bf Subproject 413e39c5681d181720440f2a8b7391f581788d7
diff --git a/lib/chibios-contrib b/lib/chibios-contrib
Subproject 61baa6b036138c155f7cfc5646d833d9423f324 Subproject 9c2bfa6aeba993345f5425d82807c101f8e25e6
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 34d6af2e6..9298661ad 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -47,7 +47,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) {
47 47
48#ifdef DIRECT_PINS 48#ifdef DIRECT_PINS
49 49
50static void init_pins(void) { 50__attribute__((weak)) void matrix_init_pins(void) {
51 for (int row = 0; row < MATRIX_ROWS; row++) { 51 for (int row = 0; row < MATRIX_ROWS; row++) {
52 for (int col = 0; col < MATRIX_COLS; col++) { 52 for (int col = 0; col < MATRIX_COLS; col++) {
53 pin_t pin = direct_pins[row][col]; 53 pin_t pin = direct_pins[row][col];
@@ -58,7 +58,7 @@ static void init_pins(void) {
58 } 58 }
59} 59}
60 60
61static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 61__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
62 // Start with a clear matrix row 62 // Start with a clear matrix row
63 matrix_row_t current_row_value = 0; 63 matrix_row_t current_row_value = 0;
64 64
@@ -90,14 +90,14 @@ static void unselect_rows(void) {
90 } 90 }
91} 91}
92 92
93static void init_pins(void) { 93__attribute__((weak)) void matrix_init_pins(void) {
94 unselect_rows(); 94 unselect_rows();
95 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 95 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
96 setPinInputHigh_atomic(col_pins[x]); 96 setPinInputHigh_atomic(col_pins[x]);
97 } 97 }
98} 98}
99 99
100static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 100__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
101 // Start with a clear matrix row 101 // Start with a clear matrix row
102 matrix_row_t current_row_value = 0; 102 matrix_row_t current_row_value = 0;
103 103
@@ -138,14 +138,14 @@ static void unselect_cols(void) {
138 } 138 }
139} 139}
140 140
141static void init_pins(void) { 141__attribute__((weak)) void matrix_init_pins(void) {
142 unselect_cols(); 142 unselect_cols();
143 for (uint8_t x = 0; x < MATRIX_ROWS; x++) { 143 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
144 setPinInputHigh_atomic(row_pins[x]); 144 setPinInputHigh_atomic(row_pins[x]);
145 } 145 }
146} 146}
147 147
148static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 148__attribute__((weak)) bool matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
149 bool matrix_changed = false; 149 bool matrix_changed = false;
150 150
151 // Select col 151 // Select col
@@ -190,7 +190,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
190 190
191void matrix_init(void) { 191void matrix_init(void) {
192 // initialize key pins 192 // initialize key pins
193 init_pins(); 193 matrix_init_pins();
194 194
195 // initialize matrix state: all keys off 195 // initialize matrix state: all keys off
196 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 196 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
@@ -209,12 +209,12 @@ uint8_t matrix_scan(void) {
209#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) 209#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
210 // Set row, read cols 210 // Set row, read cols
211 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) { 211 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
212 changed |= read_cols_on_row(raw_matrix, current_row); 212 changed |= matrix_read_cols_on_row(raw_matrix, current_row);
213 } 213 }
214#elif (DIODE_DIRECTION == ROW2COL) 214#elif (DIODE_DIRECTION == ROW2COL)
215 // Set col, read rows 215 // Set col, read rows
216 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { 216 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
217 changed |= read_rows_on_col(raw_matrix, current_col); 217 changed |= matrix_read_rows_on_col(raw_matrix, current_col);
218 } 218 }
219#endif 219#endif
220 220
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 039e7d977..a54ea90b3 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -61,7 +61,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) {
61 61
62#ifdef DIRECT_PINS 62#ifdef DIRECT_PINS
63 63
64static void init_pins(void) { 64__attribute__((weak)) void matrix_init_pins(void) {
65 for (int row = 0; row < MATRIX_ROWS; row++) { 65 for (int row = 0; row < MATRIX_ROWS; row++) {
66 for (int col = 0; col < MATRIX_COLS; col++) { 66 for (int col = 0; col < MATRIX_COLS; col++) {
67 pin_t pin = direct_pins[row][col]; 67 pin_t pin = direct_pins[row][col];
@@ -72,7 +72,7 @@ static void init_pins(void) {
72 } 72 }
73} 73}
74 74
75static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 75__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
76 // Start with a clear matrix row 76 // Start with a clear matrix row
77 matrix_row_t current_row_value = 0; 77 matrix_row_t current_row_value = 0;
78 78
@@ -104,14 +104,14 @@ static void unselect_rows(void) {
104 } 104 }
105} 105}
106 106
107static void init_pins(void) { 107__attribute__((weak)) void matrix_init_pins(void) {
108 unselect_rows(); 108 unselect_rows();
109 for (uint8_t x = 0; x < MATRIX_COLS; x++) { 109 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
110 setPinInputHigh_atomic(col_pins[x]); 110 setPinInputHigh_atomic(col_pins[x]);
111 } 111 }
112} 112}
113 113
114static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) { 114__attribute__((weak)) bool matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
115 // Start with a clear matrix row 115 // Start with a clear matrix row
116 matrix_row_t current_row_value = 0; 116 matrix_row_t current_row_value = 0;
117 117
@@ -152,14 +152,14 @@ static void unselect_cols(void) {
152 } 152 }
153} 153}
154 154
155static void init_pins(void) { 155__attribute__((weak)) void matrix_init_pins(void) {
156 unselect_cols(); 156 unselect_cols();
157 for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { 157 for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
158 setPinInputHigh_atomic(row_pins[x]); 158 setPinInputHigh_atomic(row_pins[x]);
159 } 159 }
160} 160}
161 161
162static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) { 162__attribute__((weak)) bool matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
163 bool matrix_changed = false; 163 bool matrix_changed = false;
164 164
165 // Select col 165 // Select col
@@ -233,7 +233,7 @@ void matrix_init(void) {
233 thatHand = ROWS_PER_HAND - thisHand; 233 thatHand = ROWS_PER_HAND - thisHand;
234 234
235 // initialize key pins 235 // initialize key pins
236 init_pins(); 236 matrix_init_pins();
237 237
238 // initialize matrix state: all keys off 238 // initialize matrix state: all keys off
239 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 239 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
@@ -293,12 +293,12 @@ uint8_t matrix_scan(void) {
293#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW) 293#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
294 // Set row, read cols 294 // Set row, read cols
295 for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { 295 for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
296 local_changed |= read_cols_on_row(raw_matrix, current_row); 296 local_changed |= matrix_read_cols_on_row(raw_matrix, current_row);
297 } 297 }
298#elif (DIODE_DIRECTION == ROW2COL) 298#elif (DIODE_DIRECTION == ROW2COL)
299 // Set col, read rows 299 // Set col, read rows
300 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { 300 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
301 local_changed |= read_rows_on_col(raw_matrix, current_col); 301 local_changed |= matrix_read_rows_on_col(raw_matrix, current_col);
302 } 302 }
303#endif 303#endif
304 304