diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-04-09 19:31:30 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-04-09 19:31:30 +0800 |
| commit | de096ea780245c8beb748839120e5669fe37d457 (patch) | |
| tree | 1f8ee90f3a452cfbeb67d18f52fbfbd3cb6d7e21 /Ding.Makefile | |
| parent | e34917da814c2cdb3710553d479df0aed3979e28 (diff) | |
| download | avr-nrf24l01-driver-de096ea780245c8beb748839120e5669fe37d457.tar.gz | |
Rename and fix pdlen read.
Diffstat (limited to 'Ding.Makefile')
| -rw-r--r-- | Ding.Makefile | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Ding.Makefile b/Ding.Makefile new file mode 100644 index 0000000..2f31bc2 --- /dev/null +++ b/Ding.Makefile @@ -0,0 +1,44 @@ +CC = avr-gcc +MCU = atmega328p +TARGET = ding + +SRC = ding.c uart.c nrfm.c +OBJ = $(SRC:.c=.o) + +CFLAGS = -std=gnu99 +CFLAGS += -Os +CFLAGS += -Wall +CFLAGS += -mmcu=$(MCU) +CFLAGS += -DBAUD=115200 +CFLAGS += -DF_CPU=16000000UL +CFLAGS += -ffunction-sections -fdata-sections + +LDFLAGS = -mmcu=$(MCU) +LDFLAGS += -Wl,--gc-sections + +HEX_FLAGS = -O ihex +HEX_FLAGS += -j .text -j .data + +AVRDUDE_FLAGS = -p $(MCU) +AVRDUDE_FLAGS += -c arduino +AVRDUDE_FLAGS += -P /dev/cuaU0 +AVRDUDE_FLAGS += -D -U + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +elf: $(OBJ) + $(CC) $(LDFLAGS) $(OBJ) -o $(TARGET).elf + +hex: elf + avr-objcopy $(HEX_FLAGS) $(TARGET).elf $(TARGET).hex + +upload: hex + avrdude $(AVRDUDE_FLAGS) flash:w:$(TARGET).hex:i + +.PHONY: clean + +clean: + rm *.o *.elf *.hex + + |
