From a456c4a52df5b78fac43455888f2c7708cc372ca Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Wed, 17 Feb 2021 13:04:46 +0100 Subject: [PATCH] Make watchdogReset() force_inline It makes no sense keeping watchdogReset as a separate function which must be called, since it only contains one instruction: "wdr". Not only was the code larger by 32 bytes in total, but also much slower (call+ret take 4 cycles together for no reason in this case). Surprisingly, doing just this on FW 3.9.3 solves issue #2954 on the one affected EINSY board, even though it makes not much sense (there must be some other timing issue). --- Firmware/optiboot_w25x20cl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/optiboot_w25x20cl.cpp b/Firmware/optiboot_w25x20cl.cpp index dce4074e1..2d3a76c72 100644 --- a/Firmware/optiboot_w25x20cl.cpp +++ b/Firmware/optiboot_w25x20cl.cpp @@ -43,7 +43,7 @@ static void watchdogConfig(uint8_t x) { WDTCSR = x; } -static void watchdogReset() { +static FORCE_INLINE void watchdogReset() { __asm__ __volatile__ ( "wdr\n" );