Skip to content

Commit

Permalink
Got Linux enviroment and CH551 working partly
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhiyuan Wan committed Mar 17, 2018
1 parent ede0284 commit b85b988
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.swp
*.lck
*.autosave
*~

# GNU/Make
*/*.s
Expand All @@ -19,3 +20,4 @@
*.rel
*.rst
*.sym
*.bin
12 changes: 10 additions & 2 deletions examples/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# toolchain
CC = sdcc
OBJCOPY = objcopy
PACK_HEX = packihx
WCHISP = wchisptool

#######################################################

Expand All @@ -20,7 +22,7 @@ endif

CFLAGS = -V -mmcs51 --model-small \
--xram-size $(XRAM_SIZE) --xram-loc $(XRAM_LOC) \
--code-size 0x37FF \
--code-size 0x2800 \
-I../../include -DFREQ_SYS=$(FREQ_SYS) \
$(EXTRA_FLAGS)

Expand All @@ -42,8 +44,14 @@ $(TARGET).ihx: $(RELS)
$(TARGET).hex: $(TARGET).ihx
$(PACK_HEX) $(TARGET).ihx > $(TARGET).hex

$(TARGET).bin: $(TARGET).ihx
$(OBJCOPY) -I ihex -O binary $(TARGET).ihx $(TARGET).bin

flash: $(TARGET).bin
$(WCHISP) -f $(TARGET).bin -g

.DEFAULT_GOAL := all
all: $(TARGET).hex
all: $(TARGET).bin

clean:
rm -f \
Expand Down

0 comments on commit b85b988

Please sign in to comment.