current working changes
This commit is contained in:
11
Makefile
11
Makefile
@@ -17,6 +17,7 @@ CFLAGS?=-Datmega328p\
|
||||
-DARDUINO=200\
|
||||
-DARDUINO_AVR_NANO\
|
||||
-DARDUINO_ARCH_AVR\
|
||||
-std=c++11\
|
||||
-Os\
|
||||
-ffunction-sections\
|
||||
-fdata-sections\
|
||||
@@ -59,9 +60,9 @@ SRC_FILES?=./$(ARDUINO_DIR)/cores/arduino/main.cpp\
|
||||
./$(NANOPB_DIR)/pb_common.c\
|
||||
./gateway/message.pb.c
|
||||
|
||||
build: $(OUT)$(NAME).hex
|
||||
build: $(OUT)$(NAME)
|
||||
|
||||
$(OUT)$(NAME).hex: $(OUT)$(NAME).elf
|
||||
$(OUT)$(NAME): $(OUT)$(NAME).elf
|
||||
$(OBJCOPY) -R .eeprom -O ihex $(OUT)$(NAME).elf $(OUT)$(NAME).hex
|
||||
$(OUT)eep.hex: $(OUT)$(NAME).elf
|
||||
$(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $(OUT)$(NAME).elf $(OUT)eep.hex
|
||||
@@ -70,13 +71,17 @@ $(OUT)$(NAME).elf: protobuf bin
|
||||
|
||||
protobuf:
|
||||
mkdir -p protobuf/gateway
|
||||
python external/nanopb/generator/nanopb_generator.py gateway/message.proto -D protobuf
|
||||
python3 external/nanopb/generator/nanopb_generator.py gateway/message.proto -D protobuf
|
||||
|
||||
bin:
|
||||
mkdir bin
|
||||
|
||||
flash:
|
||||
avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:$(OUT)$(NAME).hex:i
|
||||
|
||||
stop:
|
||||
avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:nothing.hex:i
|
||||
|
||||
clean:
|
||||
rm -r protobuf
|
||||
rm -r bin
|
||||
|
||||
Reference in New Issue
Block a user