File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -409,8 +409,6 @@ void pwmout_period_us(pwmout_t* obj, int us) {
409
409
if (pwm_mode == MODE_MTU2 ) {
410
410
/* PWM by MTU2 */
411
411
int tmp_pwm ;
412
- uint16_t tmp_tgra ;
413
- uint16_t tmp_tgrc ;
414
412
uint8_t tmp_tcr_up ;
415
413
uint8_t tmp_tstr_sp ;
416
414
uint8_t tmp_tstr_st ;
@@ -467,12 +465,10 @@ void pwmout_period_us(pwmout_t* obj, int us) {
467
465
* MTU2_PWM_MATCH [tmp_pwm ][MTU2_PERIOD ] = (uint16_t )wk_cycle ; // Set period
468
466
469
467
// Set duty again(TGRA)
470
- tmp_tgra = * TGRA_MATCH [obj -> ch ];
471
- set_mtu2_duty_again (& tmp_tgra , wk_last_cycle , wk_cycle );
468
+ set_mtu2_duty_again (TGRA_MATCH [obj -> ch ], wk_last_cycle , wk_cycle );
472
469
if ((obj -> ch == 0 ) || (obj -> ch == 3 ) || (obj -> ch == 4 )) {
473
470
// Set duty again(TGRC)
474
- tmp_tgrc = * TGRC_MATCH [obj -> ch ];
475
- set_mtu2_duty_again (& tmp_tgrc , wk_last_cycle , wk_cycle );
471
+ set_mtu2_duty_again (TGRC_MATCH [obj -> ch ], wk_last_cycle , wk_cycle );
476
472
}
477
473
* TMDR_MATCH [obj -> ch ] = 0x02 ; // PWM mode 1
478
474
@@ -566,7 +562,6 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
566
562
value = (float )us / (float )period_ch1 ;
567
563
}
568
564
}
569
-
570
- pwmout_write (obj , value );
571
565
}
566
+ pwmout_write (obj , value );
572
567
}
Original file line number Diff line number Diff line change @@ -542,8 +542,6 @@ void pwmout_period_us(pwmout_t* obj, int us) {
542
542
if (pwm_mode == MODE_MTU2 ) {
543
543
/* PWM by MTU2 */
544
544
int tmp_pwm ;
545
- uint16_t tmp_tgra ;
546
- uint16_t tmp_tgrc ;
547
545
uint8_t tmp_tcr_up ;
548
546
uint8_t tmp_tstr_sp ;
549
547
uint8_t tmp_tstr_st ;
@@ -600,12 +598,10 @@ void pwmout_period_us(pwmout_t* obj, int us) {
600
598
* MTU2_PWM_MATCH [tmp_pwm ][MTU2_PERIOD ] = (uint16_t )wk_cycle ; // Set period
601
599
602
600
// Set duty again(TGRA)
603
- tmp_tgra = * TGRA_MATCH [obj -> ch ];
604
- set_mtu2_duty_again (& tmp_tgra , wk_last_cycle , wk_cycle );
601
+ set_mtu2_duty_again (TGRA_MATCH [obj -> ch ], wk_last_cycle , wk_cycle );
605
602
if ((obj -> ch == 0 ) || (obj -> ch == 3 ) || (obj -> ch == 4 )) {
606
603
// Set duty again(TGRC)
607
- tmp_tgrc = * TGRC_MATCH [obj -> ch ];
608
- set_mtu2_duty_again (& tmp_tgrc , wk_last_cycle , wk_cycle );
604
+ set_mtu2_duty_again (TGRC_MATCH [obj -> ch ], wk_last_cycle , wk_cycle );
609
605
}
610
606
* TMDR_MATCH [obj -> ch ] = 0x02 ; // PWM mode 1
611
607
@@ -699,7 +695,6 @@ void pwmout_pulsewidth_us(pwmout_t* obj, int us) {
699
695
value = (float )us / (float )period_ch1 ;
700
696
}
701
697
}
702
-
703
- pwmout_write (obj , value );
704
698
}
699
+ pwmout_write (obj , value );
705
700
}
You can’t perform that action at this time.
0 commit comments