Skip to content

Commit

Permalink
Move tmk_core/common/<plat> (#13918)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Nov 19, 2021
1 parent 43b9e23 commit 2728603
Show file tree
Hide file tree
Showing 107 changed files with 54 additions and 54 deletions.
7 changes: 4 additions & 3 deletions build_keyboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ VPATH += $(COMMON_VPATH)
include common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/protocol.mk
include $(TMK_PATH)/common.mk
include $(PLATFORM_PATH)/common.mk
include $(BUILDDEFS_PATH)/bootloader.mk

SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
Expand All @@ -404,13 +404,14 @@ ifneq ($(REQUIRE_PLATFORM_KEY),)
endif
endif

include $(TMK_PATH)/$(PLATFORM_KEY).mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk

ifneq ($(strip $(PROTOCOL)),)
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
else
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
endif
-include $(TOP_DIR)/platforms/$(PLATFORM_KEY)/flash.mk

# TODO: remove this bodge?
PROJECT_DEFS := $(OPT_DEFS)
Expand Down
6 changes: 3 additions & 3 deletions build_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ endif

include common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/common.mk
include $(PLATFORM_PATH)/common.mk
include $(TMK_PATH)/protocol.mk
include $(QUANTUM_PATH)/debounce/tests/rules.mk
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
include $(TMK_PATH)/common/test/rules.mk
include $(PLATFORM_PATH)/test/rules.mk
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk
endif
Expand All @@ -73,7 +73,7 @@ $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)

include $(TMK_PATH)/native.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
include $(TMK_PATH)/rules.mk


Expand Down
4 changes: 3 additions & 1 deletion common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ QUANTUM_SRC += \

VPATH += $(QUANTUM_DIR)/logging
# Fall back to lib/printf if there is no platform provided print
ifeq ("$(wildcard $(TMK_PATH)/common/$(PLATFORM_KEY)/printf.mk)","")
ifeq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk)","")
include $(QUANTUM_PATH)/logging/print.mk
else
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk
endif

ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes)
Expand Down
2 changes: 1 addition & 1 deletion docs/feature_layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Once you have a good feel for how layers work and what you can do, you can get m

Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.

Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h).
Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h).

## Functions :id=functions

Expand Down
2 changes: 1 addition & 1 deletion docs/fr-fr/faq_keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cette page couvre les questions souvent posées à propos des keymaps. Si vous n

Regardez [Keycodes](keycodes.md) pour une liste des keycodes disponibles. Certains keycodes spécifiques ont des documentations plus complètes de disponible.

Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h).

## Quels sont les keycodes par défaut ?

Expand Down
2 changes: 1 addition & 1 deletion docs/internals_gpio_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ QMK has a GPIO control abstraction layer which is microcontroller agnostic. This

## Functions :id=functions

The following functions provide basic control of GPIOs and are found in `tmk_core/common/<platform>/gpio.h`.
The following functions provide basic control of GPIOs and are found in `platforms/<platform>/gpio.h`.

|Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples |
|------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------|
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/faq_keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## どのキーコードを使えますか?
あなたが利用可能なキーコードのインデックスについては、[キーコード](ja/keycodes.md)を見てください。より広範なドキュメントがある場合は、そこからリンクしてあります。

キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h) で定義されています。
キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h) で定義されています。

## デフォルトのキーコードとは何か?

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/feature_layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし

レイヤーは番号順に上に積み重なっています。キーの押下の動作を決定する時に、QMK は上から順にレイヤーを走査し、`KC_TRNS` に設定されていない最初のアクティブなレイヤーに到達すると停止します。結果として、現在のレイヤーよりも数値的に低いレイヤーをアクティブにし、現在のレイヤー(あるいはアクティブでターゲットレイヤーよりも高い別のレイヤー)に `KC_TRNS` 以外のものがある場合、それが送信されるキーであり、アクティブ化したばかりのレイヤー上のキーではありません。これが、ほとんどの人の "なぜレイヤーが切り替わらないのか" 問題の原因です。

場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h) で見つけることができます。
場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h) で見つけることができます。

## 関数 :id=functions

Expand Down
2 changes: 1 addition & 1 deletion docs/ja/pr_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- 「旧式の」 GPIO/I2C/SPI 関数を使用しない - 正当な理由がない限り、QMK の抽象化を使用しなければなりません (怠惰は正当な理由にはなりません)
- タイミングの抽象化にも従う必要があります:
- `_delay_ms()` のかわりに `wait_ms()` を。(`#include <util/delay.h>` も消します)
- `timer_read()``timer_read32()` など。 -- タイミング API は [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) を参照してください
- `timer_read()``timer_read32()` など。 -- タイミング API は [timer.h](https://github.com/qmk/qmk_firmware/blob/master/platforms/timer.h) を参照してください
- 新しい抽象化が有用だと思う場合は、次のことをお勧めします:
- 機能が完成するまで自分のキーボードでプロトタイプを作成する
- Discord の QMK コラボレータと話し合う
Expand Down
2 changes: 1 addition & 1 deletion docs/pr_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If there are any inconsistencies with these recommendations, you're best off [cr
- no "old-school" or other low-level GPIO/I2C/SPI functions may be used -- must use QMK abstractions unless justifiable (and laziness is not valid justification)
- timing abstractions should be followed too:
- `wait_ms()` instead of `_delay_ms()` (remove `#include <util/delay.h>` too)
- `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/timer.h) for the timing APIs
- `timer_read()` and `timer_read32()` etc. -- see [timer.h](https://github.com/qmk/qmk_firmware/blob/master/platforms/timer.h) for the timing APIs
- if you think a new abstraction is useful, you're encouraged to:
- prototype it in your own keyboard until it's feature-complete
- discuss it with QMK Collaborators on Discord
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-cn/faq_keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## 我能用什么键码?
[键码](keycodes.md)你可以找到你能用的键码索引。可以的话这些链接可以连接到更广泛的文档。

键码实际上定义在[common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
键码实际上定义在[common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h).

## 默认的键码什么样?

Expand Down
2 changes: 1 addition & 1 deletion keyboards/ai03/orbit/split_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "quantum.h"

#ifdef EE_HANDS
# include "tmk_core/common/eeprom.h"
# include "eeprom.h"
# include "eeconfig.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion keyboards/cannonkeys/satisfaction75/satisfaction75.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "raw_hid.h"
#include "dynamic_keymap.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "version.h" // for QMK_BUILDDATE used in EEPROM magic

/* Artificial delay added to get media keys to work in the encoder*/
Expand Down
2 changes: 1 addition & 1 deletion keyboards/cannonkeys/satisfaction75/satisfaction_encoder.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "satisfaction75.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"

void pre_encoder_mode_change(){
if(encoder_mode == ENC_MODE_CLOCK_SET){
Expand Down
2 changes: 1 addition & 1 deletion keyboards/mxss/mxss.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include QMK_KEYBOARD_H
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "action_layer.h"
#include "rgblight.h"
#include "via.h"
Expand Down
2 changes: 1 addition & 1 deletion keyboards/mxss/mxss_frontled.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include "mxss_frontled.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "rgblight.h"
#include "via.h"
#include "version.h" // for QMK_BUILDDATE used in EEPROM magic
Expand Down
2 changes: 1 addition & 1 deletion keyboards/wilba_tech/wt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "via.h"

#ifndef VIA_ENABLE
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "version.h" // for QMK_BUILDDATE used in EEPROM magic
#endif

Expand Down
2 changes: 1 addition & 1 deletion keyboards/wilba_tech/wt_mono_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "progmem.h"
#include "quantum/color.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"

#include "via.h" // uses EEPROM address, lighting value IDs
#define MONO_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR)
Expand Down
2 changes: 1 addition & 1 deletion keyboards/wilba_tech/wt_rgb_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL];

#include "progmem.h"
#include "quantum/color.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"

#include "via.h" // uses EEPROM address, lighting value IDs
#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR (VIA_EEPROM_CUSTOM_CONFIG_ADDR)
Expand Down
3 changes: 3 additions & 0 deletions paths.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ DRIVER_PATH = $(DRIVER_DIR)
PLATFORM_DIR = platforms
PLATFORM_PATH = $(PLATFORM_DIR)

PROTOCOL_DIR = protocol
PROTOCOL_PATH = $(TMK_DIR)/$(PROTOCOL_DIR)

BUILDDEFS_DIR = builddefs
BUILDDEFS_PATH = $(BUILDDEFS_DIR)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tmk_core/avr.mk → platforms/avr/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ifeq ($(strip $(QMK_BOOTLOADER_TYPE)),)
else
make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean
$(QMK_BIN) generate-dfu-header --quiet --keyboard $(KEYBOARD) --output lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Keyboard.h
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(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 MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/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))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions platforms/common.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY)

TMK_COMMON_SRC += \
$(PLATFORM_COMMON_DIR)/platform.c \
$(PLATFORM_COMMON_DIR)/suspend.c \
$(PLATFORM_COMMON_DIR)/timer.c \
$(PLATFORM_COMMON_DIR)/bootloader.c \

# Search Path
VPATH += $(PLATFORM_PATH)
VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)
VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions tmk_core/common/test/rules.mk → platforms/test/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ eeprom_stm32_large_DEFS := $(eeprom_stm32_DEFS) \
-DFEE_PAGE_COUNT=16

eeprom_stm32_INC := \
$(TMK_PATH)/common/chibios/
$(PLATFORM_PATH)/chibios/
eeprom_stm32_tiny_INC := $(eeprom_stm32_INC)
eeprom_stm32_large_INC := $(eeprom_stm32_INC)

eeprom_stm32_SRC := \
$(TOP_DIR)/drivers/eeprom/eeprom_driver.c \
$(TMK_PATH)/common/test/eeprom_stm32_tests.cpp \
$(TMK_PATH)/common/test/flash_stm32_mock.c \
$(TMK_PATH)/common/chibios/eeprom_stm32.c
$(PLATFORM_PATH)/$(PLATFORM_KEY)/eeprom_stm32_tests.cpp \
$(PLATFORM_PATH)/$(PLATFORM_KEY)/flash_stm32_mock.c \
$(PLATFORM_PATH)/chibios/eeprom_stm32.c
eeprom_stm32_tiny_SRC := $(eeprom_stm32_SRC)
eeprom_stm32_large_SRC := $(eeprom_stm32_SRC)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion quantum/debounce/tests/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
DEBOUNCE_COMMON_DEFS := -DMATRIX_ROWS=4 -DMATRIX_COLS=10 -DDEBOUNCE=5

DEBOUNCE_COMMON_SRC := $(QUANTUM_PATH)/debounce/tests/debounce_test_common.cpp \
$(TMK_PATH)/common/test/timer.c
$(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c

debounce_sym_defer_g_DEFS := $(DEBOUNCE_COMMON_DEFS)
debounce_sym_defer_g_SRC := $(DEBOUNCE_COMMON_SRC) \
Expand Down
2 changes: 1 addition & 1 deletion quantum/dynamic_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "config.h"
#include "keymap.h" // to get keymaps[][][]
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "progmem.h" // to read default from flash
#include "quantum.h" // for send_string()
#include "dynamic_keymap.h"
Expand Down
2 changes: 1 addition & 1 deletion quantum/sequencer/tests/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ sequencer_SRC := \
$(QUANTUM_PATH)/sequencer/tests/midi_mock.c \
$(QUANTUM_PATH)/sequencer/tests/sequencer_tests.cpp \
$(QUANTUM_PATH)/sequencer/sequencer.c \
$(TMK_PATH)/common/test/timer.c
$(PLATFORM_PATH)/$(PLATFORM_KEY)/timer.c
2 changes: 1 addition & 1 deletion quantum/via.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include "raw_hid.h"
#include "dynamic_keymap.h"
#include "tmk_core/common/eeprom.h"
#include "eeprom.h"
#include "version.h" // for QMK_BUILDDATE used in EEPROM magic
#include "via_ensure_keycode.h"

Expand Down
6 changes: 3 additions & 3 deletions testlist.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TEST_LIST = $(notdir $(patsubst %/rules.mk,%,$(wildcard $(ROOT_DIR)/tests/*/rules.mk)))
FULL_TESTS := $(TEST_LIST)

include $(ROOT_DIR)/quantum/debounce/tests/testlist.mk
include $(ROOT_DIR)/quantum/sequencer/tests/testlist.mk
include $(ROOT_DIR)/tmk_core/common/test/testlist.mk
include $(QUANTUM_PATH)/debounce/tests/testlist.mk
include $(QUANTUM_PATH)/sequencer/tests/testlist.mk
include $(PLATFORM_PATH)/test/testlist.mk

define VALIDATE_TEST_LIST
ifneq ($1,)
Expand Down
16 changes: 0 additions & 16 deletions tmk_core/common.mk

This file was deleted.

2 changes: 0 additions & 2 deletions tmk_core/protocol.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
PROTOCOL_DIR = protocol

TMK_COMMON_SRC += \
$(PROTOCOL_DIR)/host.c \
$(PROTOCOL_DIR)/report.c \
Expand Down
2 changes: 1 addition & 1 deletion tmk_core/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc)
SIZE_MARGIN = 1024

check-size:
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(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 MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
$(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi))
$(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE)))
$(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE)))
Expand Down

0 comments on commit 2728603

Please sign in to comment.