Browse Source

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).
D.R.racer 3 years ago
parent
commit
a456c4a52d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Firmware/optiboot_w25x20cl.cpp

+ 1 - 1
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"
   );