Skip to content

Commit

Permalink
snek-duino: Use -mcall-prologues to save ROM
Browse files Browse the repository at this point in the history
This un-inlines function setup/teardown and uses a function for that
(shades of the Ritchie C compiler on the PDP-11)

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Apr 13, 2019
1 parent 8b02bd1 commit 310810e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snek-duino/Makefile
Expand Up @@ -30,7 +30,7 @@ ELF=$(BASE).elf
HEX=$(BASE).hex
MAP=$(BASE).map
CC=avr-gcc
CFLAGS=-Os -DF_CPU=16000000UL -mmcu=atmega328p -I. -g -fno-jump-tables $(SNEK_CFLAGS)
CFLAGS=-Os -DF_CPU=16000000UL -mmcu=atmega328p -I. -g -fno-jump-tables $(SNEK_CFLAGS) -mcall-prologues
LDFLAGS=-Wl,-uvfprintf -lprintf_flt -lm \
-Wl,--defsym -Wl,__TEXT_REGION_LENGTH__=0x8000 \
-Wl,--defsym -Wl,__DATA_REGION_LENGTH__=0x7a0 \
Expand Down Expand Up @@ -82,8 +82,8 @@ set-fuse:
avrdude -F -V -c $(ISP) -p ATMEGA328P -U hfuse:w:0xd7:m
avrdude -F -V -c $(ISP) -p ATMEGA328P -U efuse:w:0xfd:m

load: $(HEX)
avrdude -F -V -c $(ISP) -p ATMEGA328P -U flash:w:$(HEX)
load: $(HEX) snek-duino-install
./snek-duino-install -isp $(ISP) -hex $(HEX) load

install: snek-duino-install $(HEX) snek-duino-install.1
install -d $(DESTDIR)$(BINDIR)
Expand Down

0 comments on commit 310810e

Please sign in to comment.