Commit 619e2f67 authored by Sven Greiner's avatar Sven Greiner

Add fuse settings for ATtiny to source code

Also make some tiny improvements to the Makefile related to fuses.
parent 8dbe1b93
......@@ -2,8 +2,8 @@
MCU = attiny13
F_CPU = 4800000
#LFUSE = 0x6a
#HFUSE = 0xff
#LFUSE = 0x75
#HFUSE = 0xFF
TARGET = rampinglight
SRC = $(TARGET).c
......@@ -122,7 +122,7 @@ eeprom: $(TARGET).eep
readfuses:
$(AVRDUDE) $(AVRDUDE_FLAGS) -U lfuse:r:-:i -U hfuse:r:-:i
$(AVRDUDE) $(AVRDUDE_FLAGS) -U lfuse:r:-:h -U hfuse:r:-:h
#writefuses:
......@@ -137,9 +137,9 @@ writefuses: $(TARGET).elf
$(if $(word 3,$(FUSES)),-U efuse:w:0x$(word 3,$(FUSES)):m)
printfuses: FUSES = $(shell $(OBJDUMP) -s --section=.fuse $(TARGET).elf | tail -1 | awk '{print substr($$2,1,2),substr($$2,3,2),substr($$2,5,2)}')
printfuses: FUSES = $(shell $(OBJDUMP) -s --section=.fuse $(TARGET).elf | tail -1 | awk '{printf "l:0x%s h:0x%s e:0x%s",substr($$2,1,2),substr($$2,3,2),substr($$2,5,2)}')
printfuses: $(TARGET).elf
@echo 'FUSES = $(FUSES)'
@echo '$(FUSES)'
%.hex: %.elf
......@@ -175,6 +175,8 @@ clean:
$(REMOVE) "$(TARGET).eep"
$(REMOVE) "$(TARGET).elf"
$(REMOVE) "$(TARGET).lss"
$(REMOVE) "$(TARGET).i"
$(REMOVE) "$(TARGET).s"
$(REMOVEDIR) "$(OBJDIR)"
......
......@@ -57,6 +57,14 @@
#define BATTCHECK_PRESSES FIXED_SIZE+1
#define CONFIG_PRESSES 10
/**
* Fuses for ATtiny13
*/
FUSES = {
.low = (FUSE_SPIEN & FUSE_SUT1 & FUSE_CKSEL1),
.high = HFUSE_DEFAULT,
};
/**
* States of the state machine.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment