forked from mirror/qmk_firmware
add __attribute__((always_inline)) to some functions
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#ifdef USE_SERIAL
|
#ifdef USE_SERIAL
|
||||||
|
|
||||||
|
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||||
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
||||||
|
|
||||||
// Serial pulse period in microseconds.
|
// Serial pulse period in microseconds.
|
||||||
@@ -75,12 +76,14 @@ void serial_delay_half2(void) {
|
|||||||
_delay_us(SERIAL_DELAY_HALF2);
|
_delay_us(SERIAL_DELAY_HALF2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_output(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_output(void) {
|
void serial_output(void) {
|
||||||
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make the serial pin an input with pull-up resistor
|
// make the serial pin an input with pull-up resistor
|
||||||
|
inline static void serial_input_with_pullup(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_input_with_pullup(void) {
|
void serial_input_with_pullup(void) {
|
||||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||||
@@ -92,11 +95,13 @@ uint8_t serial_read_pin(void) {
|
|||||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_low(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_low(void) {
|
void serial_low(void) {
|
||||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_high(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_high(void) {
|
void serial_high(void) {
|
||||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||||
|
|||||||
Reference in New Issue
Block a user