mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 03:30:14 +01:00
all: Use "static inline" consistently in function definitions.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This commit is contained in:
committed by
Damien George
parent
3546f23143
commit
7d50952c2b
@@ -171,12 +171,12 @@ uint32_t ra_gpio_get_pull(uint32_t pin);
|
|||||||
uint32_t ra_gpio_get_af(uint32_t pin);
|
uint32_t ra_gpio_get_af(uint32_t pin);
|
||||||
uint32_t ra_gpio_get_drive(uint32_t pin);
|
uint32_t ra_gpio_get_drive(uint32_t pin);
|
||||||
|
|
||||||
inline static void pwpr_unprotect(void) {
|
static inline void pwpr_unprotect(void) {
|
||||||
_PWPR &= (uint8_t) ~0x80;
|
_PWPR &= (uint8_t) ~0x80;
|
||||||
_PWPR |= (uint8_t)0x40;
|
_PWPR |= (uint8_t)0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void pwpr_protect(void) {
|
static inline void pwpr_protect(void) {
|
||||||
_PWPR &= (uint8_t) ~0x40;
|
_PWPR &= (uint8_t) ~0x40;
|
||||||
_PWPR |= (uint8_t)0x80;
|
_PWPR |= (uint8_t)0x80;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ typedef struct {
|
|||||||
recursive_mutex_t mutex;
|
recursive_mutex_t mutex;
|
||||||
} recursive_mutex_nowait_t;
|
} recursive_mutex_nowait_t;
|
||||||
|
|
||||||
inline static void recursive_mutex_nowait_init(recursive_mutex_nowait_t *mtx) {
|
static inline void recursive_mutex_nowait_init(recursive_mutex_nowait_t *mtx) {
|
||||||
recursive_mutex_init(&mtx->mutex);
|
recursive_mutex_init(&mtx->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static bool recursive_mutex_nowait_try_enter(recursive_mutex_nowait_t *mtx, uint32_t *owner_out) {
|
static inline bool recursive_mutex_nowait_try_enter(recursive_mutex_nowait_t *mtx, uint32_t *owner_out) {
|
||||||
return recursive_mutex_try_enter(&mtx->mutex, owner_out);
|
return recursive_mutex_try_enter(&mtx->mutex, owner_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -205,11 +205,11 @@ void dma_unprotect_rx_region(void *dest, size_t len);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
inline static void dma_protect_rx_region(uint8_t *dest, size_t len) {
|
static inline void dma_protect_rx_region(uint8_t *dest, size_t len) {
|
||||||
// No-ops on targets without D-Cache.
|
// No-ops on targets without D-Cache.
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void dma_unprotect_rx_region(void *dest, size_t len) {
|
static inline void dma_unprotect_rx_region(void *dest, size_t len) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
void mp_cstack_init_with_sp_here(size_t stack_size);
|
void mp_cstack_init_with_sp_here(size_t stack_size);
|
||||||
|
|
||||||
inline static void mp_cstack_init_with_top(void *top, size_t stack_size) {
|
static inline void mp_cstack_init_with_top(void *top, size_t stack_size) {
|
||||||
MP_STATE_THREAD(stack_top) = (char *)top;
|
MP_STATE_THREAD(stack_top) = (char *)top;
|
||||||
|
|
||||||
#if MICROPY_STACK_CHECK
|
#if MICROPY_STACK_CHECK
|
||||||
@@ -54,7 +54,7 @@ void mp_cstack_check(void);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
inline static void mp_cstack_check(void) {
|
static inline void mp_cstack_check(void) {
|
||||||
// No-op when stack checking is disabled
|
// No-op when stack checking is disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -493,7 +493,7 @@ static inline bool mp_mul_ull_overflow(unsigned long long int x, unsigned long l
|
|||||||
#if __has_builtin(__builtin_saddll_overflow) || MP_GCC_HAS_BUILTIN_OVERFLOW
|
#if __has_builtin(__builtin_saddll_overflow) || MP_GCC_HAS_BUILTIN_OVERFLOW
|
||||||
#define mp_add_ll_overflow __builtin_saddll_overflow
|
#define mp_add_ll_overflow __builtin_saddll_overflow
|
||||||
#else
|
#else
|
||||||
inline static bool mp_add_ll_overflow(long long int lhs, long long int rhs, long long int *res) {
|
static inline bool mp_add_ll_overflow(long long int lhs, long long int rhs, long long int *res) {
|
||||||
bool overflow;
|
bool overflow;
|
||||||
|
|
||||||
if (rhs > 0) {
|
if (rhs > 0) {
|
||||||
@@ -513,7 +513,7 @@ inline static bool mp_add_ll_overflow(long long int lhs, long long int rhs, long
|
|||||||
#if __has_builtin(__builtin_ssubll_overflow) || MP_GCC_HAS_BUILTIN_OVERFLOW
|
#if __has_builtin(__builtin_ssubll_overflow) || MP_GCC_HAS_BUILTIN_OVERFLOW
|
||||||
#define mp_sub_ll_overflow __builtin_ssubll_overflow
|
#define mp_sub_ll_overflow __builtin_ssubll_overflow
|
||||||
#else
|
#else
|
||||||
inline static bool mp_sub_ll_overflow(long long int lhs, long long int rhs, long long int *res) {
|
static inline bool mp_sub_ll_overflow(long long int lhs, long long int rhs, long long int *res) {
|
||||||
bool overflow;
|
bool overflow;
|
||||||
|
|
||||||
if (rhs > 0) {
|
if (rhs > 0) {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ extern const mp_obj_type_t mp_type_usb_device_builtin_default;
|
|||||||
extern const mp_obj_type_t mp_type_usb_device_builtin_none;
|
extern const mp_obj_type_t mp_type_usb_device_builtin_none;
|
||||||
|
|
||||||
// Return true if any built-in driver is enabled
|
// Return true if any built-in driver is enabled
|
||||||
inline static bool mp_usb_device_builtin_enabled(const mp_obj_usb_device_t *usbd) {
|
static inline bool mp_usb_device_builtin_enabled(const mp_obj_usb_device_t *usbd) {
|
||||||
return usbd->builtin_driver != MP_OBJ_FROM_PTR(&mp_type_usb_device_builtin_none);
|
return usbd->builtin_driver != MP_OBJ_FROM_PTR(&mp_type_usb_device_builtin_none);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user