File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ class TonePwmConfig {
64
64
uint8_t nrf_pin; // < the nrf pin for playback
65
65
nrf_pwm_task_t task_to_start; // < Whether to start playback at SEQ0 or SEQ1
66
66
nrf_pwm_short_mask_t shorts; // < shortcuts to enable
67
-
68
67
public:
69
68
bool ensurePwmPeripheralOwnership (void );
70
69
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
112
111
(duration / 1000ULL ) * frequency :
113
112
(((uint64_t )duration) * frequency / 1000ULL );
114
113
};
115
- static int _bits_used (unsigned long x) {
114
+ constexpr static int _bits_used (unsigned long x) {
116
115
if (0 == x) return 0 ;
117
116
unsigned int result = 0 ;
118
117
do {
119
118
result++;
120
119
} while (x >>= 1 );
121
120
return result;
122
121
}
123
- static int _bits_used (unsigned long long x) {
122
+ constexpr static int _bits_used (unsigned long long x) {
124
123
if (0 == x) return 0 ;
125
124
unsigned int result = 0 ;
126
125
do {
You can’t perform that action at this time.
0 commit comments