@@ -309,7 +309,7 @@ bool TONE_PWM_CONFIG::InitializeFromPulseCountAndTimePeriod(uint64_t pulse_count
309
309
// split the number of bits between refresh and loop_count in 2:1 ratio
310
310
// so that, no matter what inputs are given, guaranteed to have interrupt-free solution
311
311
unsigned int bits_for_refresh = bits_needed * 2 / 3 ; // range is [1 .. 24]
312
- unsigned int bits_for_loop_count = bits_needed - bits_for_refresh; // range is [1 .. 13]
312
+ // unsigned int bits_for_loop_count = bits_needed - bits_for_refresh; // range is [1 .. 13]
313
313
314
314
// NOTE: Due to final SEQ1 outputting exactly one pulse, may need one additional bit for loop count
315
315
// ... but that will still be within the 16 bits available, because top of range is 13 bits.
@@ -371,10 +371,11 @@ bool TONE_PWM_CONFIG::ApplyConfiguration(uint32_t pin) noexcept {
371
371
// static sequence value ... This is the value actually used
372
372
// during playback ... do NOT modify without semaphore *and*
373
373
// having ensured playback has stopped!
374
- static uint16_t seq_values[1 ] = { this ->duty_with_polarity };
374
+ static uint16_t seq_values; // static value
375
+ seq_values = this ->duty_with_polarity ;
375
376
376
- nrf_pwm_seq_ptr_set (_PWMInstance, 0 , &seq_values[ 0 ] );
377
- nrf_pwm_seq_ptr_set (_PWMInstance, 1 , &seq_values[ 0 ] );
377
+ nrf_pwm_seq_ptr_set (_PWMInstance, 0 , &seq_values);
378
+ nrf_pwm_seq_ptr_set (_PWMInstance, 1 , &seq_values);
378
379
nrf_pwm_seq_cnt_set (_PWMInstance, 0 , 1 );
379
380
nrf_pwm_seq_cnt_set (_PWMInstance, 1 , 1 );
380
381
0 commit comments