From 6861b8f5d15513fa18630bbf1f303265a5330d81 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Tue, 30 Jul 2019 21:48:00 +0200 Subject: [PATCH] Added force inline to reduce code size --- hardware0.hpp | 11 +++++------ hardware1.hpp | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hardware0.hpp b/hardware0.hpp index 9014a41..e72868c 100644 --- a/hardware0.hpp +++ b/hardware0.hpp @@ -41,7 +41,6 @@ enum class ControlFlagsA0 { DATA_REG_EMPTY = UDRE0, TRANSMIT_COMPLETE = TXC0, RECEIVE_COMPLETE = RXC0, - }; enum class ControlFlagsB0 { @@ -86,7 +85,7 @@ constexpr int operator<<(const int &lhs, const ControlFlagsC0 &rhs) template class Hardware { public: - static void init() + static void init() FORCE_INLINE { constexpr auto baudVal = calcBaud(); @@ -107,7 +106,7 @@ class Hardware { *Registers::CTRL_STAT_REG_C = controlRegC; } - static void txByte(typename cfg::data_t byte) + static void txByte(typename cfg::data_t byte) FORCE_INLINE { while (!(*Registers::CTRL_STAT_REG_A & (1 << CtrlFlagsA::DATA_REG_EMPTY))) ; @@ -220,7 +219,7 @@ class Hardware0 { using data_t = typename cfg::data_t; static constexpr auto DATA_BITS = cfg::DATA_BITS; - static void init() + static void init() FORCE_INLINE { HardwareImpl::init(); } @@ -230,9 +229,9 @@ class Hardware0 { HardwareImpl::txByte(byte); } - static data_t rxByte() {} + static data_t rxByte() FORCE_INLINE {} - static data_t peek() {} + static data_t peek() FORCE_INLINE {} private: using HardwareImpl = detail::Hardware