@@ -48,7 +48,7 @@ void TimerPeripheral::init() {
4848 handle->Init .Prescaler = init_data.prescaler ;
4949 handle->Init .CounterMode = TIM_COUNTERMODE_UP;
5050 handle->Init .AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
51- for (PWMData pwm_data : init_data.pwm_channels ) {
51+ for (PWMData & pwm_data : init_data.pwm_channels ) {
5252 if (pwm_data.mode == PHASED) {
5353 handle->Init .CounterMode = TIM_COUNTERMODE_CENTERALIGNED1;
5454 break ;
@@ -91,7 +91,7 @@ void TimerPeripheral::init() {
9191 ErrorHandler (" Unable to configure master synchronization on %d" , name.c_str ());
9292 }
9393
94- for (pair<uint32_t , uint32_t > channels_rising_falling : init_data.input_capture_channels ) {
94+ for (pair<uint32_t , uint32_t > & channels_rising_falling : init_data.input_capture_channels ) {
9595 sConfigIC .ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING;
9696 sConfigIC .ICPrescaler = TIM_ICPSC_DIV1;
9797 sConfigIC .ICFilter = 0 ;
@@ -107,7 +107,7 @@ void TimerPeripheral::init() {
107107 }
108108 }
109109
110- for (PWMData pwm_data : init_data.pwm_channels ) {
110+ for (PWMData & pwm_data : init_data.pwm_channels ) {
111111 sConfigOC .OCPolarity = init_data.polarity ;
112112 sConfigOC .OCNPolarity = init_data.negated_polarity ;
113113 sConfigOC .OCFastMode = TIM_OCFAST_DISABLE;
@@ -159,7 +159,7 @@ void TimerPeripheral::init() {
159159}
160160
161161void TimerPeripheral::start () {
162- for (TimerPeripheral timer : timers) {
162+ for (TimerPeripheral & timer : timers) {
163163 if (timer.is_registered ()) {
164164 timer.init ();
165165 }
0 commit comments