[fluksod + avr] include freshly compiled avr binaries into the flukso package
This commit is contained in:
parent
0b18afa8cc
commit
fc90003688
|
@ -72,11 +72,11 @@ FORMAT = ihex
|
||||||
|
|
||||||
|
|
||||||
# Target file name (without extension).
|
# Target file name (without extension).
|
||||||
TARGET = main
|
TARGET = $(shell git rev-parse HEAD | awk '{print substr($$0,1,16)}')
|
||||||
|
|
||||||
|
|
||||||
# List C source files here. (C dependencies are automatically generated.)
|
# List C source files here. (C dependencies are automatically generated.)
|
||||||
SRC = $(TARGET).c buffer.c uart.c spi.c ctrl.c
|
SRC = main.c buffer.c uart.c spi.c ctrl.c
|
||||||
|
|
||||||
|
|
||||||
# List Assembler source files here.
|
# List Assembler source files here.
|
||||||
|
@ -542,13 +542,13 @@ clean: begin clean_list end
|
||||||
clean_list :
|
clean_list :
|
||||||
@echo
|
@echo
|
||||||
@echo $(MSG_CLEANING)
|
@echo $(MSG_CLEANING)
|
||||||
$(REMOVE) $(TARGET).hex
|
$(REMOVE) *.hex
|
||||||
$(REMOVE) $(TARGET).eep
|
$(REMOVE) *.eep
|
||||||
$(REMOVE) $(TARGET).cof
|
$(REMOVE) *.cof
|
||||||
$(REMOVE) $(TARGET).elf
|
$(REMOVE) *.elf
|
||||||
$(REMOVE) $(TARGET).map
|
$(REMOVE) *.map
|
||||||
$(REMOVE) $(TARGET).sym
|
$(REMOVE) *.sym
|
||||||
$(REMOVE) $(TARGET).lss
|
$(REMOVE) *.lss
|
||||||
$(REMOVE) $(OBJ)
|
$(REMOVE) $(OBJ)
|
||||||
$(REMOVE) $(LST)
|
$(REMOVE) $(LST)
|
||||||
$(REMOVE) $(SRC:.c=.s)
|
$(REMOVE) $(SRC:.c=.s)
|
||||||
|
|
|
@ -29,6 +29,11 @@ define Build/Prepare
|
||||||
$(CP) ./luasrc/* $(PKG_BUILD_DIR)/
|
$(CP) ./luasrc/* $(PKG_BUILD_DIR)/
|
||||||
$(CP) ./config/* $(PKG_BUILD_DIR)/
|
$(CP) ./config/* $(PKG_BUILD_DIR)/
|
||||||
$(CP) -r ./files $(PKG_BUILD_DIR)/
|
$(CP) -r ./files $(PKG_BUILD_DIR)/
|
||||||
|
|
||||||
|
make -C ../../../avr clean
|
||||||
|
make -C ../../../avr
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)/avr
|
||||||
|
$(CP) ../../../avr/*.{hex,eep} $(PKG_BUILD_DIR)/avr/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
FLUKSO_COMMIT:=$(shell git rev-parse HEAD | awk '{print substr($$0,1,16)}')
|
FLUKSO_COMMIT:=$(shell git rev-parse HEAD | awk '{print substr($$0,1,16)}')
|
||||||
|
@ -65,6 +70,9 @@ define Package/flukso/install
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdude.lua $(1)/usr/bin/fdude
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdude.lua $(1)/usr/bin/fdude
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fcheck.sh $(1)/usr/bin/fcheck
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fcheck.sh $(1)/usr/bin/fcheck
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/restful.lua $(1)/usr/bin/restful
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/restful.lua $(1)/usr/bin/restful
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin/avr
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/avr/*.{hex,eep} $(1)/usr/bin/avr/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,flukso))
|
$(eval $(call BuildPackage,flukso))
|
||||||
|
|
|
@ -21,6 +21,24 @@ load_config()
|
||||||
logger 'configuring flukso device and sensor ids'
|
logger 'configuring flukso device and sensor ids'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
program_sensor_board()
|
||||||
|
{
|
||||||
|
AVRDUDE=fdude
|
||||||
|
|
||||||
|
MCU=atmega168p
|
||||||
|
PROGRAMMER=gpio
|
||||||
|
FLAGS="-p $MCU -c $PROGRAMMER"
|
||||||
|
FUSES="-U lfuse:w:0xEC:m -U hfuse:w:0xD6:m -U efuse:w:0x01:m"
|
||||||
|
|
||||||
|
AVRDIR=/usr/bin/avr
|
||||||
|
HEXFILE=$(find $AVRDIR/*.hex)
|
||||||
|
EEPFILE=$(find $AVRDIR/*.eep)
|
||||||
|
|
||||||
|
FLASH="-U flash:w:$HEXFILE"
|
||||||
|
EEPROM="-U eeprom:w:$EEPFILE"
|
||||||
|
|
||||||
|
$AVRDUDE $FLAGS $FUSES $FLASH $EEPROM
|
||||||
|
}
|
||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
|
@ -29,6 +47,7 @@ start()
|
||||||
if [ $FIRSTBOOT -eq '1' ]
|
if [ $FIRSTBOOT -eq '1' ]
|
||||||
then
|
then
|
||||||
load_config
|
load_config
|
||||||
|
program_sensor_board
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 666 /dev/spidev0.0
|
chmod 666 /dev/spidev0.0
|
||||||
|
|
Loading…
Reference in New Issue