aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-11-27 23:08:21 -0500
committerGitHub <noreply@github.com>2017-11-27 23:08:21 -0500
commit9fdc27626097ae03b767a09427efc90475d90955 (patch)
treea555c38f1b714af6e2c2c96187552757d08224b9 /tmk_core
parent9113f3387a670373919fe62899b0ab27e9d89eba (diff)
downloadqmk_firmware-9fdc27626097ae03b767a09427efc90475d90955.tar.gz
qmk_firmware-9fdc27626097ae03b767a09427efc90475d90955.zip
Updates bootloader settings, adds file size check (#2029)
* pull fuse settings for bootloader jump * fix 32a chips * make automatic bootloader selection optional * quantify bootloaders * fixs #164, speeds up dfu reset * fix for chips w/o usb * missing an n * fix bootloader sizes, use words for addresses * fix bmini, pearl, and [[ issue, make things quiet * ignore avr errors on arm for now * update settings for the light * document bootloader stuff * add bootloader title
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk10
-rw-r--r--tmk_core/common/avr/bootloader.c196
-rw-r--r--tmk_core/common/avr/bootloader_size.c20
-rw-r--r--tmk_core/rules.mk23
4 files changed, 145 insertions, 104 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 94e9a7bdb..c083f6b72 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -121,22 +121,22 @@ qmk: $(BUILD_DIR)/$(TARGET).hex
121 printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk 121 printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk
122 122
123# Program the device. 123# Program the device.
124program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep 124program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep check-size
125 $(PROGRAM_CMD) 125 $(PROGRAM_CMD)
126 126
127teensy: $(BUILD_DIR)/$(TARGET).hex 127teensy: $(BUILD_DIR)/$(TARGET).hex check-size
128 $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex 128 $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex
129 129
130BATCHISP ?= batchisp 130BATCHISP ?= batchisp
131 131
132flip: $(BUILD_DIR)/$(TARGET).hex 132flip: $(BUILD_DIR)/$(TARGET).hex check-size
133 $(BATCHISP) -hardware usb -device $(MCU) -operation erase f 133 $(BATCHISP) -hardware usb -device $(MCU) -operation erase f
134 $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program 134 $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program
135 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0 135 $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0
136 136
137DFU_PROGRAMMER ?= dfu-programmer 137DFU_PROGRAMMER ?= dfu-programmer
138 138
139dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter 139dfu: $(BUILD_DIR)/$(TARGET).hex check-size
140 until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ 140 until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\
141 echo "Error: Bootloader not found. Trying again in 5s." ;\ 141 echo "Error: Bootloader not found. Trying again in 5s." ;\
142 sleep 5 ;\ 142 sleep 5 ;\
@@ -168,7 +168,7 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep
168 fi 168 fi
169 $(DFU_PROGRAMMER) $(MCU) reset 169 $(DFU_PROGRAMMER) $(MCU) reset
170 170
171avrdude: $(BUILD_DIR)/$(TARGET).hex 171avrdude: $(BUILD_DIR)/$(TARGET).hex check-size
172 if grep -q -s Microsoft /proc/version; then \ 172 if grep -q -s Microsoft /proc/version; then \
173 echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ 173 echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \
174 else \ 174 else \
diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c
index 34db8d0b0..ee150817c 100644
--- a/tmk_core/common/avr/bootloader.c
+++ b/tmk_core/common/avr/bootloader.c
@@ -6,6 +6,7 @@
6#include <avr/wdt.h> 6#include <avr/wdt.h>
7#include <util/delay.h> 7#include <util/delay.h>
8#include "bootloader.h" 8#include "bootloader.h"
9#include <avr/boot.h>
9 10
10#ifdef PROTOCOL_LUFA 11#ifdef PROTOCOL_LUFA
11#include <LUFA/Drivers/USB/USB.h> 12#include <LUFA/Drivers/USB/USB.h>
@@ -56,14 +57,17 @@
56 * | Bootloader | 512B | Bootloader | 1KB 57 * | Bootloader | 512B | Bootloader | 1KB
57 * 0x7FFF +---------------+ 0x1FFFF +---------------+ 58 * 0x7FFF +---------------+ 0x1FFFF +---------------+
58 */ 59 */
59#ifndef BOOTLOADER_SIZE
60#warning To use bootloader_jump() you need to define BOOTLOADER_SIZE in config.h.
61#define BOOTLOADER_SIZE 4096
62#endif
63 60
64#define FLASH_SIZE (FLASHEND + 1L) 61#define FLASH_SIZE (FLASHEND + 1L)
65#define BOOTLOADER_START (FLASH_SIZE - BOOTLOADER_SIZE) 62
63#if !defined(BOOTLOADER_SIZE)
64 uint16_t bootloader_start;
65#endif
66 66
67#define BOOT_SIZE_256 0b110
68#define BOOT_SIZE_512 0b100
69#define BOOT_SIZE_1024 0b010
70#define BOOT_SIZE_2048 0b000
67 71
68/* 72/*
69 * Entering the Bootloader via Software 73 * Entering the Bootloader via Software
@@ -74,34 +78,62 @@ uint32_t reset_key __attribute__ ((section (".noinit")));
74 78
75/* initialize MCU status by watchdog reset */ 79/* initialize MCU status by watchdog reset */
76void bootloader_jump(void) { 80void bootloader_jump(void) {
77 #ifndef CATERINA_BOOTLOADER
78
79 #ifdef PROTOCOL_LUFA
80 USB_Disable();
81 cli();
82 _delay_ms(2000);
83 #endif
84
85 #ifdef PROTOCOL_PJRC
86 cli();
87 UDCON = 1;
88 USBCON = (1<<FRZCLK);
89 UCSR1B = 0;
90 _delay_ms(5);
91 #endif
92
93 #ifdef BOOTLOADHID_BOOTLOADER
94 // force bootloadHID to stay in bootloader mode, so that it waits
95 // for a new firmware to be flashed
96 eeprom_write_byte((uint8_t *)1, 0x00);
97 #endif
98 81
99 // watchdog reset 82 #if !defined(BOOTLOADER_SIZE)
100 reset_key = BOOTLOADER_RESET_KEY; 83 uint8_t high_fuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS);
101 wdt_enable(WDTO_250MS); 84
102 for (;;); 85 if (high_fuse & BOOT_SIZE_256) {
86 bootloader_start = (FLASH_SIZE - 512) >> 1;
87 } else if (high_fuse & BOOT_SIZE_512) {
88 bootloader_start = (FLASH_SIZE - 1024) >> 1;
89 } else if (high_fuse & BOOT_SIZE_1024) {
90 bootloader_start = (FLASH_SIZE - 2048) >> 1;
91 } else {
92 bootloader_start = (FLASH_SIZE - 4096) >> 1;
93 }
94 #endif
103 95
104 #else 96 // Something like this might work, but it compiled larger than the block above
97 // bootloader_start = FLASH_SIZE - (256 << (~high_fuse & 0b110 >> 1));
98
99
100 #if defined(BOOTLOADER_HALFKAY)
101 // http://www.pjrc.com/teensy/jump_to_bootloader.html
102 cli();
103 // disable watchdog, if enabled (it's not)
104 // disable all peripherals
105 // a shutdown call might make sense here
106 UDCON = 1;
107 USBCON = (1<<FRZCLK); // disable USB
108 UCSR1B = 0;
109 _delay_ms(5);
110 #if defined(__AVR_AT90USB162__) // Teensy 1.0
111 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0;
112 TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
113 DDRB = 0; DDRC = 0; DDRD = 0;
114 PORTB = 0; PORTC = 0; PORTD = 0;
115 asm volatile("jmp 0x3E00");
116 #elif defined(__AVR_ATmega32U4__) // Teensy 2.0
117 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
118 TIMSK0 = 0; TIMSK1 = 0; TIMSK3 = 0; TIMSK4 = 0; UCSR1B = 0; TWCR = 0;
119 DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0; TWCR = 0;
120 PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
121 asm volatile("jmp 0x7E00");
122 #elif defined(__AVR_AT90USB646__) // Teensy++ 1.0
123 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
124 TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
125 DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
126 PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
127 asm volatile("jmp 0xFC00");
128 #elif defined(__AVR_AT90USB1286__) // Teensy++ 2.0
129 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
130 TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
131 DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
132 PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
133 asm volatile("jmp 0x1FC00");
134 #endif
135
136 #elif defined(BOOTLOADER_CATERINA)
105 // this block may be optional 137 // this block may be optional
106 // TODO: figure it out 138 // TODO: figure it out
107 139
@@ -118,83 +150,65 @@ void bootloader_jump(void) {
118 150
119 while(1) {} // wait for watchdog timer to trigger 151 while(1) {} // wait for watchdog timer to trigger
120 152
153 #else // Assume remaining boards are DFU, even if the flag isn't set
154
155 #ifndef __AVR_ATmega32A__ // no USB - maybe BOOTLOADER_BOOTLOADHID instead though?
156 UDCON = 1;
157 USBCON = (1<<FRZCLK); // disable USB
158 UCSR1B = 0;
159 _delay_ms(5); // 5 seems to work fine
160 #endif
161
162 #ifdef BOOTLOADER_BOOTLOADHID
163 // force bootloadHID to stay in bootloader mode, so that it waits
164 // for a new firmware to be flashed
165 eeprom_write_byte((uint8_t *)1, 0x00);
166 #endif
167
168 // watchdog reset
169 reset_key = BOOTLOADER_RESET_KEY;
170 wdt_enable(WDTO_250MS);
171 for (;;);
121 #endif 172 #endif
173
122} 174}
123 175
124#ifdef __AVR_ATmega32A__ 176#ifdef __AVR_ATmega32A__
125// MCUSR is actually called MCUCSR in ATmega32A 177 // MCUSR is actually called MCUCSR in ATmega32A
126#define MCUSR MCUCSR 178 #define MCUSR MCUCSR
127#endif 179#endif
128 180
129/* this runs before main() */ 181/* this runs before main() */
130void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, section (".init3"))); 182void bootloader_jump_after_watchdog_reset(void) __attribute__ ((used, naked, section (".init3")));
131void bootloader_jump_after_watchdog_reset(void) 183void bootloader_jump_after_watchdog_reset(void)
132{ 184{
133 if ((MCUSR & (1<<WDRF)) && reset_key == BOOTLOADER_RESET_KEY) { 185 #ifndef BOOTLOADER_HALFKAY
134 reset_key = 0; 186 if ((MCUSR & (1<<WDRF)) && reset_key == BOOTLOADER_RESET_KEY) {
187 reset_key = 0;
188
189 // My custom USBasploader requires this to come up.
190 MCUSR = 0;
135 191
136 // My custom USBasploader requires this to come up. 192 // Seems like Teensy halfkay loader requires clearing WDRF and disabling watchdog.
137 MCUSR = 0; 193 MCUSR &= ~(1<<WDRF);
194 wdt_disable();
138 195
139 // Seems like Teensy halfkay loader requires clearing WDRF and disabling watchdog.
140 MCUSR &= ~(1<<WDRF);
141 wdt_disable();
142 196
143 // This is compled into 'icall', address should be in word unit, not byte. 197 // This is compled into 'icall', address should be in word unit, not byte.
144 ((void (*)(void))(BOOTLOADER_START/2))(); 198 #ifdef BOOTLOADER_SIZE
145 } 199 ((void (*)(void))( (FLASH_SIZE - BOOTLOADER_SIZE) >> 1))();
200 #else
201 asm("ijmp" :: "z" (bootloader_start));
202 #endif
203 }
204 #endif
146} 205}
147 206
148 207
149#if 0 208#if 0
150/* Jumping To The Bootloader
151 * http://www.pjrc.com/teensy/jump_to_bootloader.html
152 *
153 * This method doen't work when using LUFA. idk why.
154 * - needs to initialize more regisers or interrupt setting?
155 */
156void bootloader_jump(void) {
157#ifdef PROTOCOL_LUFA
158 USB_Disable();
159 cli();
160 _delay_ms(2000);
161#endif
162
163#ifdef PROTOCOL_PJRC
164 cli();
165 UDCON = 1;
166 USBCON = (1<<FRZCLK);
167 UCSR1B = 0;
168 _delay_ms(5);
169#endif
170
171 /*
172 * Initialize
173 */
174#if defined(__AVR_AT90USB162__)
175 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0;
176 TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
177 DDRB = 0; DDRC = 0; DDRD = 0;
178 PORTB = 0; PORTC = 0; PORTD = 0;
179#elif defined(__AVR_ATmega32U4__)
180 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
181 TIMSK0 = 0; TIMSK1 = 0; TIMSK3 = 0; TIMSK4 = 0; UCSR1B = 0; TWCR = 0;
182 DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0; TWCR = 0;
183 PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
184#elif defined(__AVR_AT90USB646__)
185 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
186 TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
187 DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
188 PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
189#elif defined(__AVR_AT90USB1286__)
190 EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
191 TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
192 DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
193 PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
194#endif
195
196 /* 209 /*
197 * USBaspLoader 210 * USBaspLoader - I'm not sure if this is used at all in any projects
211 * would love to support it if it is -Jack
198 */ 212 */
199#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) 213#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__)
200 // This makes custom USBasploader come up. 214 // This makes custom USBasploader come up.
diff --git a/tmk_core/common/avr/bootloader_size.c b/tmk_core/common/avr/bootloader_size.c
new file mode 100644
index 000000000..0d8d534f8
--- /dev/null
+++ b/tmk_core/common/avr/bootloader_size.c
@@ -0,0 +1,20 @@
1// Copyright 2017 Jack Humbert
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 2 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16#include <avr/io.h>
17#include <avr/boot.h>
18
19// this is not valid C - it's for computing the size available on the chip
20AVR_SIZE: FLASHEND + 1 - BOOTLOADER_SIZE \ No newline at end of file
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 53e79ef47..920a7f6ad 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -216,6 +216,9 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
216 216
217elf: $(BUILD_DIR)/$(TARGET).elf 217elf: $(BUILD_DIR)/$(TARGET).elf
218hex: $(BUILD_DIR)/$(TARGET).hex 218hex: $(BUILD_DIR)/$(TARGET).hex
219cphex: hex
220 $(SILENT) || printf "Copying $(TARGET).hex to qmk_firmware folder" | $(AWK_CMD)
221 $(COPY) $(BUILD_DIR)/$(TARGET).hex $(TARGET).hex && $(PRINT_OK)
219eep: $(BUILD_DIR)/$(TARGET).eep 222eep: $(BUILD_DIR)/$(TARGET).eep
220lss: $(BUILD_DIR)/$(TARGET).lss 223lss: $(BUILD_DIR)/$(TARGET).lss
221sym: $(BUILD_DIR)/$(TARGET).sym 224sym: $(BUILD_DIR)/$(TARGET).sym
@@ -223,19 +226,17 @@ LIBNAME=lib$(TARGET).a
223lib: $(LIBNAME) 226lib: $(LIBNAME)
224 227
225# Display size of file. 228# Display size of file.
226HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex 229HEXSIZE = $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex
227#ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf 230#ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
228ELFSIZE = $(SIZE) $(BUILD_DIR)/$(TARGET).elf 231ELFSIZE = $(SIZE) $(BUILD_DIR)/$(TARGET).elf
229 232
230sizebefore: 233sizebefore:
231 @if test -f $(TARGET).hex; then $(SECHO) $(MSG_SIZE_BEFORE); $(SILENT) || $(HEXSIZE); \ 234 @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO) $(MSG_SIZE_BEFORE); $(SILENT) || $(HEXSIZE); \
232 2>/dev/null; $(SECHO); fi 235 2>/dev/null; $(SECHO); fi
233 236
234sizeafter: $(BUILD_DIR)/$(TARGET).hex 237sizeafter: $(BUILD_DIR)/$(TARGET).hex
235 @if test -f $(TARGET).hex; then $(SECHO); $(SECHO) $(MSG_SIZE_AFTER); $(SILENT) || $(HEXSIZE); \ 238 @if test -f $(BUILD_DIR)/$(TARGET).hex; then $(SECHO); $(SECHO) $(MSG_SIZE_AFTER); $(SILENT) || $(HEXSIZE); \
236 2>/dev/null; $(SECHO); fi 239 2>/dev/null; $(SECHO); fi
237 # test file sizes eventually
238 # @if [[ $($(SIZE) --target=$(FORMAT) $(TARGET).hex | $(AWK) 'NR==2 {print "0x"$5}') -gt 0x200 ]]; then $(SECHO) "File is too big!"; fi
239 240
240# Display compiler version information. 241# Display compiler version information.
241gccversion : 242gccversion :
@@ -249,8 +250,6 @@ gccversion :
249 @if $(AUTOGEN); then \ 250 @if $(AUTOGEN); then \
250 $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(TARGET).hex\n"; \ 251 $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(TARGET).hex\n"; \
251 $(COPY) $@ $(KEYMAP_PATH)/$(TARGET).hex; \ 252 $(COPY) $@ $(KEYMAP_PATH)/$(TARGET).hex; \
252 else \
253 $(COPY) $@ $(TARGET).hex; \
254 fi 253 fi
255 254
256%.eep: %.elf 255%.eep: %.elf
@@ -371,6 +370,14 @@ show_path:
371 @echo SRC=$(SRC) 370 @echo SRC=$(SRC)
372 @echo OBJ=$(OBJ) 371 @echo OBJ=$(OBJ)
373 372
373check-size:
374 $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | grep -oP "(?<=AVR_SIZE: ).+"`; echo $$(($$n)) || echo 0))
375 $(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))
376 if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
377 $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \
378 if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \
379 fi
380
374# Create build directory 381# Create build directory
375$(shell mkdir -p $(BUILD_DIR) 2>/dev/null) 382$(shell mkdir -p $(BUILD_DIR) 2>/dev/null)
376 383
@@ -385,4 +392,4 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null)))
385.PHONY : all finish sizebefore sizeafter qmkversion \ 392.PHONY : all finish sizebefore sizeafter qmkversion \
386gccversion build elf hex eep lss sym coff extcoff \ 393gccversion build elf hex eep lss sym coff extcoff \
387clean clean_list debug gdb-config show_path \ 394clean clean_list debug gdb-config show_path \
388program teensy dfu flip dfu-ee flip-ee dfu-start 395program teensy dfu flip dfu-ee flip-ee dfu-start \ No newline at end of file