From d26fce792da93749ae3b50fc2fcd1dbabad6129d Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Thu, 19 Jul 2018 18:08:01 +0900 Subject: [PATCH] add __attribute__((always_inline)) to some functions --- keyboards/helix/serial.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 0bda051366..a4fd012bf8 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -14,6 +14,7 @@ #ifdef USE_SERIAL +#define ALWAYS_INLINE __attribute__((always_inline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) // Serial pulse period in microseconds. @@ -75,12 +76,14 @@ void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); } +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; @@ -92,11 +95,13 @@ uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK;