diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-02-01 20:59:22 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-02-01 20:59:24 +0530 |
| commit | 8fa32bb0414c3164d8c3467c5db4c1a912627fc4 (patch) | |
| tree | 0d1c3b5f1aa27f77b4678b6f65f38b8b09dfce37 /justfile | |
| parent | 7224fce49e4fa8c0b966dcc8d4f9b1d12b02f66a (diff) | |
| download | daft-watch-8fa32bb0414c3164d8c3467c5db4c1a912627fc4.tar.gz daft-watch-8fa32bb0414c3164d8c3467c5db4c1a912627fc4.zip | |
Remove platformio stuff and switch to avr-gcc
Diffstat (limited to '')
| -rw-r--r-- | justfile | 52 |
1 files changed, 33 insertions, 19 deletions
@@ -1,28 +1,42 @@ -build: - pio run -e attiny84; +set export +set unstable -check: - pio check --skip-packages +default: + just --choose || true -upload: - pio run -e attiny84 -t upload +AVR_LIBC := env("AVR_LIBC", "/usr/lib/avr") +F_CPU := "1000000" +MCU := "attiny84a" +MCU_PART := "attiny84" +SRC := "./src/main.c" +OUTDIR := "./out" +PROGRAMMER := "arduino" +UPLOAD_SPEED := "19200" +SERIAL_PORT := "/dev/ttyUSB0" -clean: - pio run -t clean +CFLAGS := f"-g -Os -std=gnu99 -Isrc -mmcu={{MCU}} -DF_CPU={{F_CPU}}L \ +-I{{AVR_LIBC}}/avr/include -L{{AVR_LIBC}}/avr/lib \ +-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes" -update: - pio pkg update +AVRDUDE := f"avrdude -v -p {{MCU_PART}} -c {{PROGRAMMER}} -P {{SERIAL_PORT}} -b {{UPLOAD_SPEED}}" -monitor: - pio device monitor +build: compile_flags + mkdir -p {{OUTDIR}} + avr-gcc {{CFLAGS}} {{SRC}} -o {{OUTDIR}}/out.elf + avr-objcopy -O ihex -R .eeprom {{OUTDIR}}/out.elf {{OUTDIR}}/out.hex -test: - pio test -e test +write: + [ -f "{{OUTDIR}}/out.hex" ] || (echo "No out.hex. Run build"; exit 1); + {{AVRDUDE}} -U "flash:w:{{OUTDIR}}/out.hex:i" -format: - find include/ src/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i +read: + {{AVRDUDE}} -F -U flash:r:-:h -devsetup: - # COMPILATIONDB_INCLUDE_TOOLCHAIN=true pio run -t compiledb - ./setup_compiledb.sh +clean: + rm -rf {{OUTDIR}} + +format: + find src/ -iname '*.h' -o -iname '*.c' | xargs clang-format -i +compile_flags: + echo '{{CFLAGS}}' | tr ' ' '\n' > ./compile_flags.txt |
