Disable CKDIV8 and adapt to clock div. factor

Configure fuses for the `fuses` target in Makefile to disable
`CKDIV8`. Adapt PWM generation in `lcd_update_backlight()` to new
clock division factor, as well as interrupt handling, debouncing and
dechattering.

This also enables partially lower PWM frequencies (between off and
former lowest PWM setting) for a dimmer lcd backlight.
This commit is contained in:
finga 2021-09-21 18:40:49 +02:00
parent c48e4a31ab
commit bd217ce6e7
2 changed files with 26 additions and 17 deletions

View file

@ -9,6 +9,7 @@ EEP := main.eep
BIN := main.elf
OBJ := main.o
LOW_FUSE := 0xE2
HIGH_FUSE := 0xD6
SHELL := sh
@ -42,7 +43,7 @@ eeprom: $(EEP) size
$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -U eeprom:w:$<:a
fuses:
$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -U hfuse:w:$(HIGH_FUSE):m
$(AVRDUDE) -p $(MCU) -c $(PROGRAMMER) -U lfuse:w:$(LOW_FUSE):m -U hfuse:w:$(HIGH_FUSE):m
clean:
$(RM) $(TARGET) $(EEP) $(BIN) $(OBJ)