From 3fde090a8e55163288148b37e172b11cdeb3cc50 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 30 Nov 2023 09:17:46 -0700 Subject: eliminated direct CCP register access from arch/attiny1616 (the protected write macro exists for a reason, and should be used instead) --- arch/attiny1616.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/attiny1616.c') diff --git a/arch/attiny1616.c b/arch/attiny1616.c index 2770d06..c5499dd 100644 --- a/arch/attiny1616.c +++ b/arch/attiny1616.c @@ -210,8 +210,8 @@ inline void mcu_pcint_off() { void reboot() { // put the WDT in hard reset mode, then trigger it cli(); - CCP = CCP_IOREG_gc; // temporarily disable change protection - WDT.CTRLA = WDT_PERIOD_8CLK_gc; // Enable, timeout 8ms + // Enable, timeout 8ms + _PROTECTED_WRITE(WDT.CTRLA, WDT_PERIOD_8CLK_gc); sei(); wdt_reset(); while (1) {} -- cgit v1.2.3