From 90322a718159623eee7c120c1cd6b6d483525d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sat, 13 May 2023 18:07:13 +0000 Subject: [PATCH] optimisation: always inline ReportingRAII Tested on MK3S+ using the LCD. Change in memory: Flash: -80 bytes SRAM: 0 bytes --- Firmware/mmu2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index f5082b5ef..c9152f28b 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -194,11 +194,11 @@ void MMU2::CheckFINDARunout() { struct ReportingRAII { CommandInProgress cip; - explicit inline ReportingRAII(CommandInProgress cip) + explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, (uint16_t)ProgressCode::EngagingIdler); } - inline ~ReportingRAII() { + inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, (uint16_t)ProgressCode::OK); } };