Remove make flash, use build script for flashing

This is not optimal, but could not find a way to make it flash without
verification errors with "make flash".
This commit is contained in:
2025-05-14 13:08:31 +02:00
parent 5f154cb20f
commit cbf42aae0a
2 changed files with 5 additions and 8 deletions
+4 -7
View File
@@ -2,7 +2,6 @@ PROJECT = vase-control
MCU = atmega328p
F_CPU = 16000000UL
PROGRAMMER = usbasp
ARDUINO_INSTALL_PATH = /usr/share/arduino
ARDUINO_CORE_PATH = $(ARDUINO_INSTALL_PATH)/hardware/arduino/avr/cores/arduino
@@ -12,10 +11,12 @@ CC = avr-gcc
CXX = avr-g++
LD = $(CXX)
OC = avr-objcopy
AD = avrdude
AR = avr-ar
RM = rm -f
AVRDUDE = avrdude
AVRDUDE_FLAGS = -v -p m328p -c usbasp
BUILD_DIR = build
OBJ_DIR = $(BUILD_DIR)/obj
CORE_DIR = $(BUILD_DIR)/core
@@ -65,7 +66,6 @@ $(ELF_TARGET): $(OBJS) $(CORE_LIB)
$(CORE_LIB): $(CORE_OBJS)
$(AR) rcs $@ $^
# Compile your C++ files
$(OBJ_DIR)/%.o: %.cpp $(HDRS) Makefile
$(CXX) $(CXXFLAGS) -c $< -o $@
@@ -78,11 +78,8 @@ $(CORE_DIR)/%.o: $(ARDUINO_CORE_PATH)/%.cpp Makefile
$(TARGET): $(ELF_TARGET)
$(OC) -O ihex -R .eeprom $< $@
flash: $(TARGET)
$(AD) -v -p $(MCU) -c $(PROGRAMMER) -D -U flash:w:$<:i
clean:
$(RM) $(TARGET) $(ELF_TARGET) $(OBJS) $(CORE_OBJS) $(CORE_LIB)
$(RM) -r $(BUILD_DIR)
.PHONY: all flash clean
.PHONY: all clean
+1 -1
View File
@@ -17,4 +17,4 @@ docker run --rm "$IMAGE_NAME" \
cat /usr/src/build/moisture.hex > "$DEST_HEX"
command -v avrdude >/dev/null || { echo "Install avrdude"; exit 1; }
avrdude -v -p "$MCU" -c "$PRG" $AVR_FLAGS -D -U flash:w:"$DEST_HEX":i
avrdude -v -p m328p -c usbasp -U flash:w:build/moisture.hex:i