Skip to content

Commit cda1dba

Browse files
committed
More constexpr
1 parent 1097f1a commit cda1dba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cores/nRF5/Tone.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class TonePwmConfig {
6464
uint8_t nrf_pin; //< the nrf pin for playback
6565
nrf_pwm_task_t task_to_start; //< Whether to start playback at SEQ0 or SEQ1
6666
nrf_pwm_short_mask_t shorts; //< shortcuts to enable
67-
6867
public:
6968
bool ensurePwmPeripheralOwnership(void);
7069
bool initializeFromPulseCountAndTimePeriod(uint64_t pulse_count, uint16_t time_period);
@@ -112,15 +111,15 @@ constexpr static uint64_t _calculate_pulse_count(uint32_t frequency, uint32_t du
112111
(duration / 1000ULL) * frequency :
113112
(((uint64_t)duration) * frequency / 1000ULL);
114113
};
115-
static int _bits_used(unsigned long x) {
114+
constexpr static int _bits_used(unsigned long x) {
116115
if (0 == x) return 0;
117116
unsigned int result = 0;
118117
do {
119118
result++;
120119
} while (x >>= 1);
121120
return result;
122121
}
123-
static int _bits_used(unsigned long long x) {
122+
constexpr static int _bits_used(unsigned long long x) {
124123
if (0 == x) return 0;
125124
unsigned int result = 0;
126125
do {

0 commit comments

Comments
 (0)