-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
39 lines (29 loc) · 1.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PORT := /dev/ttyACM0
FQBN := esp32:esp32:esp32s3:CDCOnBoot=cdc,DFUOnBoot=dfu,FlashSize=16M,JTAGAdapter=builtin,PartitionScheme=huge_app,PSRAM=opi,LoopCore=0,DebugLevel=info
SOURCEFILES=$(wildcard src/*.cpp src/rm67162/*.cpp)
default: T-HMI-C64.ino $(SOURCEFILES) src/loadactions.h
arduino-cli compile --fqbn $(FQBN) --build-path build T-HMI-C64.ino
src/loadactions.h: src/loadactions.asm
/opt/TMPx_v1.1.0-STYLE/linux-x86_64/tmpx src/loadactions.asm -o src/loadactions.prg
xxd -i src/loadactions.prg > src/loadactions.h
compile: default
# first you have to get the docker image:
# podman pull docker.io/retroelec42/arduino-cli:latest
podcompile: T-HMI-C64.ino $(SOURCEFILES) src/loadactions.h
podman run -it --rm -v .:/workspace/T-HMI-C64 arduino-cli compile --fqbn $(FQBN) --build-path build T-HMI-C64.ino
upload:
arduino-cli upload -p $(PORT) --fqbn $(FQBN) -i build/T-HMI-C64.ino.bin
# create file $HOME/.minirc.dfl
# content:
# pu addcarreturn Yes
monitor:
minicom -D $(PORT) -b 115200
format:
@clang-format -i *.ino src/*.cpp src/*.h
# see https://arduino.github.io/arduino-cli/1.0/getting-started/
install: check_install
arduino-cli config init --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json --overwrite
arduino-cli core update-index
arduino-cli core install esp32:[email protected]
check_install:
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]