From 7507a2b74cb26e8e554d4967f11913740dc20251 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sat, 20 Jun 2020 11:54:06 +0200 Subject: [PATCH 1/2] Split dmac_desc declaration and definition According to the official documentation[1] gcc 10 is more strict about correct extern usage. I've had to move the definition of dmac_desc and dmac_desc_wb from i2c_master.h to the corresponding .c file. This could be an issue if anyone includes the i2c_master.h file without liking with the object file. [1]: https://gcc.gnu.org/gcc-10/porting_to.html --- tmk_core/protocol/arm_atsam/i2c_master.c | 3 +++ tmk_core/protocol/arm_atsam/i2c_master.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index d3319ab447d2..dda2f85b0019 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -28,6 +28,9 @@ along with this program. If not, see . # define I2C_LED_USE_DMA 1 // Set 1 to use background DMA transfers for leds, Set 0 to use inline software transfers +DmacDescriptor dmac_desc; +DmacDescriptor dmac_desc_wb; + static uint8_t i2c_led_q[I2C_Q_SIZE]; // I2C queue circular buffer static uint8_t i2c_led_q_s; // Start of circular buffer static uint8_t i2c_led_q_e; // End of circular buffer diff --git a/tmk_core/protocol/arm_atsam/i2c_master.h b/tmk_core/protocol/arm_atsam/i2c_master.h index 44dbdfbffaaf..68773f213fbe 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.h +++ b/tmk_core/protocol/arm_atsam/i2c_master.h @@ -24,8 +24,8 @@ along with this program. If not, see . # include "issi3733_driver.h" # include "config.h" -__attribute__((__aligned__(16))) DmacDescriptor dmac_desc; -__attribute__((__aligned__(16))) DmacDescriptor dmac_desc_wb; +extern __attribute__((__aligned__(16))) DmacDescriptor dmac_desc; +extern __attribute__((__aligned__(16))) DmacDescriptor dmac_desc_wb; uint8_t I2C3733_Init_Control(void); uint8_t I2C3733_Init_Drivers(void); From 1470aaa19666ae22d3b81749757992b7260960c4 Mon Sep 17 00:00:00 2001 From: Jesper Jensen Date: Sat, 20 Jun 2020 12:20:35 +0200 Subject: [PATCH 2/2] Remove the keymap_config definition from keymaps The keymap_config def was conflicting with the one found in tmk_core/common/magic.c. Declaring it extern in magic.c breaks a bunch of keyboard that rely on that declaration (like the ergodox). Instead I've removed the one found in the keymap.c of the massdrop alt. The same change will have to be made to other keyboards. --- keyboards/massdrop/alt/keymaps/abishalom/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/bonta/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/default/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/default_md/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/mac/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/mac_md/keymap.c | 2 -- keyboards/massdrop/alt/keymaps/reywood/keymap.c | 2 -- 8 files changed, 16 deletions(-) diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c index f6f79ad91ef9..a08123b0f57e 100644 --- a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -12,8 +12,6 @@ enum alt_keycodes { #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/bonta/keymap.c b/keyboards/massdrop/alt/keymaps/bonta/keymap.c index c1acf2c151c0..9ac27f57e388 100644 --- a/keyboards/massdrop/alt/keymaps/bonta/keymap.c +++ b/keyboards/massdrop/alt/keymaps/bonta/keymap.c @@ -14,8 +14,6 @@ enum alt_keycodes { #define RGB_BRU RGB_VAI #define RGB_BRD RGB_VAD -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index 52fd35b45476..06b5d1e815ea 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -10,8 +10,6 @@ enum alt_keycodes { MD_BOOT, //Restart into bootloader after hold timeout }; -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_65_ansi_blocker( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/default_md/keymap.c b/keyboards/massdrop/alt/keymaps/default_md/keymap.c index 6523790f6da7..79ad5472627a 100644 --- a/keyboards/massdrop/alt/keymaps/default_md/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default_md/keymap.c @@ -21,8 +21,6 @@ enum alt_keycodes { MD_BOOT //Restart into bootloader after hold timeout //Working }; -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c b/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c index 873d18449b10..4c079a6aaf23 100644 --- a/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c +++ b/keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c @@ -28,8 +28,6 @@ enum alt_keycodes { // //TODO tap/toggle for layers -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_SPOT, diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index 9f575b4f126a..a99ef7300fc3 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -10,8 +10,6 @@ enum alt_keycodes { MD_BOOT, //Restart into bootloader after hold timeout }; -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c index 439e79399704..839873ce857d 100644 --- a/keyboards/massdrop/alt/keymaps/mac_md/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac_md/keymap.c @@ -21,8 +21,6 @@ enum alt_keycodes { MD_BOOT //Restart into bootloader after hold timeout //Working }; -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ diff --git a/keyboards/massdrop/alt/keymaps/reywood/keymap.c b/keyboards/massdrop/alt/keymaps/reywood/keymap.c index cf60acfe66c5..6279b509b450 100644 --- a/keyboards/massdrop/alt/keymaps/reywood/keymap.c +++ b/keyboards/massdrop/alt/keymaps/reywood/keymap.c @@ -26,8 +26,6 @@ enum alt_keycodes { #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode #define ______ KC_TRNS -keymap_config_t keymap_config; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \