summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk4
-rw-r--r--tmk_core/common.mk12
-rw-r--r--tmk_core/common/action.c14
-rw-r--r--tmk_core/common/action_tapping.c15
-rw-r--r--tmk_core/common/chibios/chibios_config.h24
-rw-r--r--tmk_core/common/command.c3
-rw-r--r--tmk_core/common/eeconfig.h2
-rw-r--r--tmk_core/common/keyboard.c26
-rw-r--r--tmk_core/common/keycode.h1
-rw-r--r--tmk_core/common/matrix.h7
-rw-r--r--tmk_core/common/mbed/bootloader.c3
-rw-r--r--tmk_core/common/mbed/suspend.c5
-rw-r--r--tmk_core/common/mbed/timer.c23
-rw-r--r--tmk_core/common/mbed/xprintf.cpp50
-rw-r--r--tmk_core/common/mbed/xprintf.h16
-rw-r--r--tmk_core/common/print.h33
-rw-r--r--tmk_core/common/wait.h2
-rw-r--r--tmk_core/ldscript_keymap_avr35.x268
-rw-r--r--tmk_core/ldscript_keymap_avr5.x268
-rw-r--r--tmk_core/protocol.mk27
-rw-r--r--tmk_core/protocol/chibios/main.c3
-rw-r--r--tmk_core/protocol/chibios/usb_main.c147
-rw-r--r--tmk_core/protocol/iwrap/main.c2
-rw-r--r--tmk_core/protocol/lufa/lufa.c11
-rw-r--r--tmk_core/protocol/mbed/HIDKeyboard.cpp260
-rw-r--r--tmk_core/protocol/mbed/HIDKeyboard.h32
-rw-r--r--tmk_core/protocol/mbed/mbed_driver.cpp21
-rw-r--r--tmk_core/protocol/mbed/mbed_driver.h3
-rw-r--r--tmk_core/protocol/ps2_io_mbed.c51
-rw-r--r--tmk_core/protocol/serial_soft.c3
-rw-r--r--tmk_core/protocol/vusb/main.c4
-rw-r--r--tmk_core/protocol/vusb/vusb.c13
-rw-r--r--tmk_core/rules.mk2
33 files changed, 179 insertions, 1176 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 1846a9b4bc..ecd2fd39a4 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -240,7 +240,7 @@ avrdude-split-right: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
$(call EXEC_AVRDUDE,eeprom-righthand.eep)
define EXEC_USBASP
- avrdude -p $(MCU) -c usbasp -U flash:w:$(BUILD_DIR)/$(TARGET).hex
+ avrdude -p $(AVRDUDE_MCU) -c usbasp -U flash:w:$(BUILD_DIR)/$(TARGET).hex
endef
usbasp: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware
@@ -321,7 +321,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf
bootloader:
make -C lib/lufa/Bootloaders/DFU/ clean
$(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS)
- $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
+ $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
$(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0))
diff --git a/tmk_core/common.mk b/tmk_core/common.mk
index d43950299b..8f355da123 100644
--- a/tmk_core/common.mk
+++ b/tmk_core/common.mk
@@ -187,18 +187,6 @@ ifeq ($(strip $(NO_USB_STARTUP_CHECK)), yes)
TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK
endif
-ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes)
- TMK_COMMON_DEFS += -DKEYMAP_SECTION_ENABLE
-
- ifeq ($(strip $(MCU)),atmega32u2)
- TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
- else ifeq ($(strip $(MCU)),atmega32u4)
- TMK_COMMON_LDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
- else
- TMK_COMMON_LDFLAGS = $(error no ldscript for keymap section)
- endif
-endif
-
ifeq ($(strip $(SHARED_EP_ENABLE)), yes)
TMK_COMMON_DEFS += -DSHARED_EP_ENABLE
endif
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index bd6aeba4f8..d6062703ee 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -47,6 +47,10 @@ int retro_tapping_counter = 0;
# include <fauxclicky.h>
#endif
+#ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
+__attribute__ ((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode) { return false; }
+#endif
+
#ifndef TAP_CODE_DELAY
# define TAP_CODE_DELAY 0
#endif
@@ -308,8 +312,12 @@ void process_action(keyrecord_t *record, action_t action) {
default:
if (event.pressed) {
if (tap_count > 0) {
-# ifndef IGNORE_MOD_TAP_INTERRUPT
- if (record->tap.interrupted) {
+# if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY)
+ if (
+# ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY
+ !get_ignore_mod_tap_interrupt(get_event_keycode(record->event)) &&
+# endif
+ record->tap.interrupted) {
dprint("mods_tap: tap: cancel: add_mods\n");
// ad hoc: set 0 to cancel tap
record->tap.count = 0;
@@ -552,7 +560,7 @@ void process_action(keyrecord_t *record, action_t action) {
action_macro_play(action_get_macro(record, action.func.id, action.func.opt));
break;
#endif
-#if defined(BACKLIGHT_ENABLE) | defined(LED_MATRIX_ENABLE)
+#if defined(BACKLIGHT_ENABLE) || defined(LED_MATRIX_ENABLE)
case ACT_BACKLIGHT:
if (!event.pressed) {
switch (action.backlight.opt) {
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c
index e0f524ad7a..c0f1f694b7 100644
--- a/tmk_core/common/action_tapping.c
+++ b/tmk_core/common/action_tapping.c
@@ -27,6 +27,10 @@ __attribute__((weak)) uint16_t get_tapping_term(uint16_t keycode) { return TAPPI
# define WITHIN_TAPPING_TERM(e) (TIMER_DIFF_16(e.time, tapping_key.event.time) < TAPPING_TERM)
# endif
+# ifdef TAPPING_FORCE_HOLD_PER_KEY
+__attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t *record) { return false; }
+# endif
+
static keyrecord_t tapping_key = {};
static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {};
static uint8_t waiting_buffer_head = 0;
@@ -111,7 +115,7 @@ bool process_tapping(keyrecord_t *keyp) {
* This can register the key before settlement of tapping,
* useful for long TAPPING_TERM but may prevent fast typing.
*/
-# if defined(TAPPING_TERM_PER_KEY) || (!defined(PER_KEY_TAPPING_TERM) && TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD)
+# if defined(TAPPING_TERM_PER_KEY) || (TAPPING_TERM >= 500) || defined(PERMISSIVE_HOLD)
# ifdef TAPPING_TERM_PER_KEY
else if ((get_tapping_term(get_event_keycode(tapping_key.event)) >= 500) && IS_RELEASED(event) && waiting_buffer_typed(event))
# else
@@ -232,8 +236,13 @@ bool process_tapping(keyrecord_t *keyp) {
if (WITHIN_TAPPING_TERM(event)) {
if (event.pressed) {
if (IS_TAPPING_KEY(event.key)) {
-# ifndef TAPPING_FORCE_HOLD
- if (!tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
+//# ifndef TAPPING_FORCE_HOLD
+# if !defined(TAPPING_FORCE_HOLD) || defined(TAPPING_FORCE_HOLD_PER_KEY)
+ if (
+# ifdef TAPPING_FORCE_HOLD_PER_KEY
+ !get_tapping_force_hold(get_event_keycode(tapping_key.event), keyp) &&
+# endif
+ !tapping_key.tap.interrupted && tapping_key.tap.count > 0) {
// sequential tap.
keyp->tap = tapping_key.tap;
if (keyp->tap.count < 15) keyp->tap.count += 1;
diff --git a/tmk_core/common/chibios/chibios_config.h b/tmk_core/common/chibios/chibios_config.h
new file mode 100644
index 0000000000..2725296083
--- /dev/null
+++ b/tmk_core/common/chibios/chibios_config.h
@@ -0,0 +1,24 @@
+/* Copyright 2019
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#if defined(STM32F1XX)
+# define USE_GPIOV1
+#endif
+
+#if defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(STM32L1XX)
+# define USE_I2CV1
+#endif
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index 82cd806091..0d6661d603 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -192,9 +192,6 @@ static void print_version(void) {
#ifdef NKRO_ENABLE
" NKRO"
#endif
-#ifdef KEYMAP_SECTION_ENABLE
- " KEYMAP_SECTION"
-#endif
" " STR(BOOTLOADER_SIZE) "\n");
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index 308f865e19..6fbe789031 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -48,6 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define EECONFIG_RGB_MATRIX_SPEED (uint8_t *)32
// TODO: Combine these into a single word and single block of EEPROM
#define EECONFIG_KEYMAP_UPPER_BYTE (uint8_t *)33
+// Size of EEPROM being used, other code can refer to this for available EEPROM
+#define EECONFIG_SIZE 34
/* debug bit */
#define EECONFIG_DEBUG_ENABLE (1 << 0)
#define EECONFIG_DEBUG_MATRIX (1 << 1)
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 63ace9793c..cb4e7637fa 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -83,6 +83,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef VELOCIKEY_ENABLE
# include "velocikey.h"
#endif
+#ifdef VIA_ENABLE
+# include "via.h"
+#endif
// Only enable this if console is enabled to print to
#if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE)
@@ -217,6 +220,9 @@ __attribute__((weak)) bool is_keyboard_master(void) { return true; }
void keyboard_init(void) {
timer_init();
matrix_init();
+#ifdef VIA_ENABLE
+ via_init();
+#endif
#ifdef QWIIC_ENABLE
qwiic_init();
#endif
@@ -254,6 +260,7 @@ void keyboard_init(void) {
#endif
#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
keymap_config.nkro = 1;
+ eeconfig_update_keymap(keymap_config.raw);
#endif
keyboard_post_init_kb(); /* Always keep this last */
}
@@ -296,13 +303,14 @@ void keyboard_task(void) {
}
#endif
if (debug_matrix) matrix_print();
- for (uint8_t c = 0; c < MATRIX_COLS; c++) {
- if (matrix_change & ((matrix_row_t)1 << c)) {
+ matrix_row_t col_mask = 1;
+ for (uint8_t c = 0; c < MATRIX_COLS; c++, col_mask <<= 1) {
+ if (matrix_change & col_mask) {
action_exec((keyevent_t){
- .key = (keypos_t){.row = r, .col = c}, .pressed = (matrix_row & ((matrix_row_t)1 << c)), .time = (timer_read() | 1) /* time should not be 0 */
+ .key = (keypos_t){.row = r, .col = c}, .pressed = (matrix_row & col_mask), .time = (timer_read() | 1) /* time should not be 0 */
});
// record a processed key
- matrix_prev[r] ^= ((matrix_row_t)1 << c);
+ matrix_prev[r] ^= col_mask;
#ifdef QMK_KEYS_PER_SCAN
// only jump out if we have processed "enough" keys.
if (++keys_processed >= QMK_KEYS_PER_SCAN)
@@ -327,6 +335,16 @@ MATRIX_LOOP_END:
matrix_scan_perf_task();
#endif
+#if defined(RGBLIGHT_ANIMATIONS) && defined(RGBLIGHT_ENABLE)
+ rgblight_task();
+#endif
+
+#if defined(BACKLIGHT_ENABLE)
+# if defined(BACKLIGHT_PIN) || defined(BACKLIGHT_PINS)
+ backlight_task();
+# endif
+#endif
+
#ifdef QWIIC_ENABLE
qwiic_task();
#endif
diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h
index fd5d606805..e1059fadf0 100644
--- a/tmk_core/common/keycode.h
+++ b/tmk_core/common/keycode.h
@@ -175,7 +175,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_MPLY KC_MEDIA_PLAY_PAUSE
#define KC_MSEL KC_MEDIA_SELECT
#define KC_EJCT KC_MEDIA_EJECT
-#define KC_MAIL KC_MAIL
#define KC_CALC KC_CALCULATOR
#define KC_MYCM KC_MY_COMPUTER
#define KC_WSCH KC_WWW_SEARCH
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h
index 7624d51376..a2fedf5ff0 100644
--- a/tmk_core/common/matrix.h
+++ b/tmk_core/common/matrix.h
@@ -40,6 +40,8 @@ typedef uint32_t matrix_col_t;
# error "MATRIX_ROWS: invalid value"
#endif
+#define MATRIX_ROW_SHIFTER ((matrix_row_t)1)
+
#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1 << col))
#ifdef __cplusplus
@@ -79,11 +81,6 @@ void matrix_scan_kb(void);
void matrix_init_user(void);
void matrix_scan_user(void);
-#ifdef I2C_SPLIT
-void slave_matrix_init(void);
-uint8_t slave_matrix_scan(void);
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/tmk_core/common/mbed/bootloader.c b/tmk_core/common/mbed/bootloader.c
deleted file mode 100644
index 88945eb050..0000000000
--- a/tmk_core/common/mbed/bootloader.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "bootloader.h"
-
-void bootloader_jump(void) {}
diff --git a/tmk_core/common/mbed/suspend.c b/tmk_core/common/mbed/suspend.c
deleted file mode 100644
index 3d0554f87b..0000000000
--- a/tmk_core/common/mbed/suspend.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <stdbool.h>
-
-void suspend_power_down(void) {}
-bool suspend_wakeup_condition(void) { return true; }
-void suspend_wakeup_init(void) {}
diff --git a/tmk_core/common/mbed/timer.c b/tmk_core/common/mbed/timer.c
deleted file mode 100644
index 7e4070af29..0000000000
--- a/tmk_core/common/mbed/timer.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "cmsis.h"
-#include "timer.h"
-
-/* Mill second tick count */
-volatile uint32_t timer_count = 0;
-
-/* Timer interrupt handler */
-void SysTick_Handler(void) { timer_count++; }
-
-void timer_init(void) {
- timer_count = 0;
- SysTick_Config(SystemCoreClock / 1000); /* 1ms tick */
-}
-
-void timer_clear(void) { timer_count = 0; }
-
-uint16_t timer_read(void) { return (uint16_t)(timer_count & 0xFFFF); }
-
-uint32_t timer_read32(void) { return timer_count; }
-
-uint16_t timer_elapsed(uint16_t last) { return TIMER_DIFF_16(timer_read(), last); }
-
-uint32_t timer_elapsed32(uint32_t last) { return TIMER_DIFF_32(timer_read32(), last); }
diff --git a/tmk_core/common/mbed/xprintf.cpp b/tmk_core/common/mbed/xprintf.cpp
deleted file mode 100644
index 184b7fa7a0..0000000000
--- a/tmk_core/common/mbed/xprintf.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <cstdarg>
-//#include <stdarg.h>
-#include "mbed.h"
-#include "mbed/xprintf.h"
-
-#define STRING_STACK_LIMIT 120
-
-// TODO
-int __xprintf(const char* format, ...) { return 0; }
-
-#if 0
-/* mbed Serial */
-Serial ser(UART_TX, UART_RX);
-
-/* TODO: Need small implementation for embedded */
-int xprintf(const char* format, ...)
-{
- /* copy from mbed/common/RawSerial.cpp */
- std::va_list arg;
- va_start(arg, format);
- int len = vsnprintf(NULL, 0, format, arg);
- if (len < STRING_STACK_LIMIT) {
- char temp[STRING_STACK_LIMIT];
- vsprintf(temp, format, arg);
- ser.puts(temp);
- } else {
- char *temp = new char[len + 1];
- vsprintf(temp, format, arg);
- ser.puts(temp);
- delete[] temp;
- }
- va_end(arg);
- return len;
-
-/* Fail: __builtin_va_arg_pack?
- * https://gcc.gnu.org/onlinedocs/gcc-4.3.5/gcc/Constructing-Calls.html#Constructing-Calls
- void *arg = __builtin_apply_args();
- void *ret = __builtin_apply((void*)(&(ser.printf)), arg, 100);
- __builtin_return(ret)
-*/
-/* Fail: varargs can not be passed to printf
- //int r = ser.printf("test %i\r\n", 123);
- va_list arg;
- va_start(arg, format);
- int r = ser.printf(format, arg);
- va_end(arg);
- return r;
-*/
-}
-#endif
diff --git a/tmk_core/common/mbed/xprintf.h b/tmk_core/common/mbed/xprintf.h
deleted file mode 100644
index e27822d3a8..0000000000
--- a/tmk_core/common/mbed/xprintf.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef XPRINTF_H
-#define XPRINTF_H
-
-//#define xprintf(format, ...) __xprintf(format, ##__VA_ARGS__)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int __xprintf(const char *format, ...);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h
index 20189838fe..04ca558109 100644
--- a/tmk_core/common/print.h
+++ b/tmk_core/common/print.h
@@ -128,38 +128,7 @@ extern "C"
# endif /* USER_PRINT / NORMAL PRINT */
-# elif defined(__arm__) /* __arm__ */
-
-# include "mbed/xprintf.h"
-
-# ifdef USER_PRINT /* USER_PRINT */
-
-// Remove normal print defines
-# define print(s)
-# define println(s)
-# define xprintf(fmt, ...)
-
-// Create user print defines
-# define uprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__)
-# define uprint(s) xprintf(s)
-# define uprintln(s) xprintf(s "\r\n")
-
-# else /* NORMAL PRINT */
-
-// Create user & normal print defines
-# define xprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__)
-# define print(s) xprintf(s)
-# define println(s) xprintf(s "\r\n")
-# define uprint(s) print(s)
-# define uprintln(s) println(s)
-# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__)
-
-# endif /* USER_PRINT / NORMAL PRINT */
-
-/* TODO: to select output destinations: UART/USBSerial */
-# define print_set_sendchar(func)
-
-# endif /* __AVR__ / PROTOCOL_CHIBIOS / PROTOCOL_ARM_ATSAM / __arm__ */
+# endif /* __AVR__ / PROTOCOL_CHIBIOS / PROTOCOL_ARM_ATSAM */
// User print disables the normal print messages in the body of QMK/TMK code and
// is meant as a lightweight alternative to NOPRINT. Use it when you only want to do
diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h
index cb1f386a61..c82cd2d65a 100644
--- a/tmk_core/common/wait.h
+++ b/tmk_core/common/wait.h
@@ -33,8 +33,6 @@ extern "C" {
# include "clks.h"
# define wait_ms(ms) CLK_delay_ms(ms)
# define wait_us(us) CLK_delay_us(us)
-#elif defined(__arm__)
-# include "wait_api.h"
#else // Unit tests
void wait_ms(uint32_t ms);
# define wait_us(us) wait_ms(us / 1000)
diff --git a/tmk_core/ldscript_keymap_avr35.x b/tmk_core/ldscript_keymap_avr35.x
deleted file mode 100644
index 6665020af9..0000000000
--- a/tmk_core/ldscript_keymap_avr35.x
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * linker script for configurable keymap
- *
- * This adds keymap section which places keymap at fixed address and
- * is based on binutils-avr ldscripts(/usr/lib/ldscripts/avr5.x).
- */
-OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
-OUTPUT_ARCH(avr:35)
-MEMORY
-{
- /* With keymap section
- *
- * Flash Map of ATMega32U4(32KB)
- * +------------+ 0x0000
- * | .vectors |
- * | .progmem |
- * | .init0-9 | > text region
- * | .text |
- * | .fini9-0 |
- * | |
- * |------------| _etext
- * | .data |
- * | .bss | > data region
- * | .noinit |
- * | |
- * |------------| 0x6800
- * | .keymap | > keymap region(2KB)
- * |------------| 0x7000
- * | bootloader | 4KB
- * +------------+ 0x7FFF
- */
- text (rx) : ORIGIN = 0, LENGTH = 64K
- keymap (rw!x) : ORIGIN = 0x6800, LENGTH = 2K
- data (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
- eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
- fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
- lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
- signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
-}
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
- .gnu.version : { *(.gnu.version) }
- .gnu.version_d : { *(.gnu.version_d) }
- .gnu.version_r : { *(.gnu.version_r) }
- .rel.init : { *(.rel.init) }
- .rela.init : { *(.rela.init) }
- .rel.text :
- {
- *(.rel.text)
- *(.rel.text.*)
- *(.rel.gnu.linkonce.t*)
- }
- .rela.text :
- {
- *(.rela.text)
- *(.rela.text.*)
- *(.rela.gnu.linkonce.t*)
- }
- .rel.fini : { *(.rel.fini) }
- .rela.fini : { *(.rela.fini) }
- .rel.rodata :
- {
- *(.rel.rodata)
- *(.rel.rodata.*)
- *(.rel.gnu.linkonce.r*)
- }
- .rela.rodata :
- {
- *(.rela.rodata)
- *(.rela.rodata.*)
- *(.rela.gnu.linkonce.r*)
- }
- .rel.data :
- {
- *(.rel.data)
- *(.rel.data.*)
- *(.rel.gnu.linkonce.d*)
- }
- .rela.data :
- {
- *(.rela.data)
- *(.rela.data.*)
- *(.rela.gnu.linkonce.d*)
- }
- .rel.ctors : { *(.rel.ctors) }
- .rela.ctors : { *(.rela.ctors) }
- .rel.dtors : { *(.rel.dtors) }
- .rela.dtors : { *(.rela.dtors) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.bss : { *(.rel.bss) }
- .rela.bss : { *(.rela.bss) }
- .rel.plt : { *(.rel.plt) }
- .rela.plt : { *(.rela.plt) }
- /* Internal text space or external memory. */
- .text :
- {
- *(.vectors)
- KEEP(*(.vectors))
- /* For data that needs to reside in the lower 64k of progmem. */
- *(.progmem.gcc*)
- *(.progmem*)
- . = ALIGN(2);
- __trampolines_start = . ;
- /* The jump trampolines for the 16-bit limited relocs will reside here. */
- *(.trampolines)
- *(.trampolines*)
- __trampolines_end = . ;
- /* For future tablejump instruction arrays for 3 byte pc devices.
- We don't relax jump/call instructions within these sections. */
- *(.jumptables)
- *(.jumptables*)
- /* For code that needs to reside in the lower 128k progmem. */
- *(.lowtext)
- *(.lowtext*)
- __ctors_start = . ;
- *(.ctors)
- __ctors_end = . ;
- __dtors_start = . ;
- *(.dtors)
- __dtors_end = . ;
- KEEP(SORT(*)(.ctors))
- KEEP(SORT(*)(.dtors))
- /* From this point on, we don't bother about wether the insns are
- below or above the 16 bits boundary. */
- *(.init0) /* Start here after reset. */
- KEEP (*(.init0))
- *(.init1)
- KEEP (*(.init1))
- *(.init2) /* Clear __zero_reg__, set up stack pointer. */
- KEEP (*(.init2))
- *(.init3)
- KEEP (*(.init3))
- *(.init4) /* Initialize data and BSS. */
- KEEP (*(.init4))
- *(.init5)
- KEEP (*(.init5))
- *(.init6) /* C++ constructors. */
- KEEP (*(.init6))
- *(.init7)
- KEEP (*(.init7))
- *(.init8)
- KEEP (*(.init8))
- *(.init9) /* Call main(). */
- KEEP (*(.init9))
- *(.text)
- . = ALIGN(2);
- *(.text.*)
- . = ALIGN(2);
- *(.fini9) /* _exit() starts here. */
- KEEP (*(.fini9))
- *(.fini8)
- KEEP (*(.fini8))
- *(.fini7)
- KEEP (*(.fini7))
- *(.fini6) /* C++ destructors. */
- KEEP (*(.fini6))
- *(.fini5)
- KEEP (*(.fini5))
- *(.fini4)
- KEEP (*(.fini4))
- *(.fini3)
- KEEP (*(.fini3))
- *(.fini2)
- KEEP (*(.fini2))
- *(.fini1)
- KEEP (*(.fini1))
- *(.fini0) /* Infinite loop after program termination. */
- KEEP (*(.fini0))
- _etext = . ;
- } > text
- .data : AT (ADDR (.text) + SIZEOF (.text))
- {
- PROVIDE (__data_start = .) ;
- *(.data)
- *(.data*)
- *(.rodata) /* We need to include .rodata here if gcc is used */
- *(.rodata*) /* with -fdata-sections. */
- *(.gnu.linkonce.d*)
- . = ALIGN(2);
- _edata = . ;
- PROVIDE (__data_end = .) ;
- } > data
- .bss : AT (ADDR (.bss))
- {
- PROVIDE (__bss_start = .) ;
- *(.bss)
- *(.bss*)
- *(COMMON)
- PROVIDE (__bss_end = .) ;
- } > data
- __data_load_start = LOADADDR(.data);
- __data_load_end = __data_load_start + SIZEOF(.data);
- /* Global data not cleared after reset. */
- .noinit :
- {
- PROVIDE (__noinit_start = .) ;
- *(.noinit*)
- PROVIDE (__noinit_end = .) ;
- _end = . ;
- PROVIDE (__heap_start = .) ;
- } > data
- /* keymap region is located at end of flash
- * .fn_actions Fn actions definitions
- * .keymaps Mapping layers
- */
- .keymap :
- {
- PROVIDE(__keymap_start = .) ;
- *(.keymap.fn_actions) /* 32*actions = 64bytes */
- . = ALIGN(0x40);
- *(.keymap.keymaps) /* rest of .keymap section */
- *(.keymap*)
- /* . = ALIGN(0x800); */ /* keymap section takes 2KB- */
- } > keymap = 0x00 /* zero fill */
- .eeprom :
- {
- *(.eeprom*)
- __eeprom_end = . ;
- } > eeprom
- .fuse :
- {
- KEEP(*(.fuse))
- KEEP(*(.lfuse))
- KEEP(*(.hfuse))
- KEEP(*(.efuse))
- } > fuse
- .lock :
- {
- KEEP(*(.lock*))
- } > lock
- .signature :
- {
- KEEP(*(.signature*))
- } > signature
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
-}
diff --git a/tmk_core/ldscript_keymap_avr5.x b/tmk_core/ldscript_keymap_avr5.x
deleted file mode 100644
index 9b46e6c36f..0000000000
--- a/tmk_core/ldscript_keymap_avr5.x
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * linker script for configurable keymap
- *
- * This adds keymap section which places keymap at fixed address and
- * is based on binutils-avr ldscripts(/usr/lib/ldscripts/avr5.x).
- */
-OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
-OUTPUT_ARCH(avr:5)
-MEMORY
-{
- /* With keymap section
- *
- * Flash Map of ATMega32U4(32KB)
- * +------------+ 0x0000
- * | .vectors |
- * | .progmem |
- * | .init0-9 | > text region
- * | .text |
- * | .fini9-0 |
- * | |
- * |------------| _etext
- * | .data |
- * | .bss | > data region
- * | .noinit |
- * | |
- * |------------| 0x6800