Skip to content

Commit

Permalink
gcc 10 compatibility for Drop alt (#9485)
Browse files Browse the repository at this point in the history
* 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

* 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.
  • Loading branch information
DelusionalLogic authored Dec 6, 2020
1 parent 7043561 commit 63d0665
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions keyboards/massdrop/alt/keymaps/abishalom/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
2 changes: 0 additions & 2 deletions keyboards/massdrop/alt/keymaps/bonta/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
2 changes: 0 additions & 2 deletions keyboards/massdrop/alt/keymaps/favorable-mutation/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions keyboards/massdrop/alt/keymaps/reywood/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
3 changes: 3 additions & 0 deletions tmk_core/protocol/arm_atsam/i2c_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

# 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
Expand Down
4 changes: 2 additions & 2 deletions tmk_core/protocol/arm_atsam/i2c_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# 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);
Expand Down

0 comments on commit 63d0665

Please sign in to comment.