Skip to content

Commit 1097f1a

Browse files
committed
inline != __attribute__((always_inline))
1 parent b7fc0a2 commit 1097f1a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cores/nRF5/Tone.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TonePwmConfig {
7474
};
7575
TonePwmConfig _pwm_config;
7676

77-
inline static bool _is_pwm_enabled(NRF_PWM_Type const * pwm_instance) {
77+
static bool _is_pwm_enabled(NRF_PWM_Type const * pwm_instance) {
7878
bool isEnabled =
7979
(pwm_instance->ENABLE & PWM_ENABLE_ENABLE_Msk) ==
8080
(PWM_ENABLE_ENABLE_Enabled << PWM_ENABLE_ENABLE_Pos);
@@ -93,13 +93,13 @@ inline static bool _is_pwm_enabled(NRF_PWM_Type const * pwm_instance) {
9393
See https://gist.github.com/henrygab/6b570ebd51354bf247633c72b8dc383b
9494
for code that compares the new lambdas to the old calculations.
9595
*/
96-
constexpr inline static uint16_t _calculate_time_period(uint32_t frequency) {
96+
constexpr static uint16_t _calculate_time_period(uint32_t frequency) {
9797
// range for frequency == [20..25000],
9898
// so range of result == [ 5..62500]
9999
// which fits in 16 bits.
100100
return 125000 / frequency;
101101
};
102-
constexpr inline static uint64_t _calculate_pulse_count(uint32_t frequency, uint32_t duration) {
102+
constexpr static uint64_t _calculate_pulse_count(uint32_t frequency, uint32_t duration) {
103103
// range for frequency == [20..25000],
104104
// range for duration == [ 1..0xFFFF_FFFF]
105105
// so range of result == [ 1..0x18_FFFF_FFE7] (requires 37 bits)
@@ -112,15 +112,15 @@ constexpr inline static uint64_t _calculate_pulse_count(uint32_t frequency, uint
112112
(duration / 1000ULL) * frequency :
113113
(((uint64_t)duration) * frequency / 1000ULL);
114114
};
115-
inline static int _bits_used(unsigned long x) {
115+
static int _bits_used(unsigned long x) {
116116
if (0 == x) return 0;
117117
unsigned int result = 0;
118118
do {
119119
result++;
120120
} while (x >>= 1);
121121
return result;
122122
}
123-
inline static int _bits_used(unsigned long long x) {
123+
static int _bits_used(unsigned long long x) {
124124
if (0 == x) return 0;
125125
unsigned int result = 0;
126126
do {

0 commit comments

Comments
 (0)