Skip to content

Commit 54e4cb6

Browse files
author
henrykotze
committed
removed param update on timer channel
1 parent 981e4d1 commit 54e4cb6

File tree

1 file changed

+2
-1
lines changed
  • platforms/nuttx/src/px4/espressif/esp32/io_pins

1 file changed

+2
-1
lines changed

platforms/nuttx/src/px4/espressif/esp32/io_pins/pwm_servo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ void get_optimal_timer_setup(uint32_t desired_freq){
158158

159159
int up_pwm_servo_set(unsigned channel, uint16_t value)
160160
{
161+
161162
uint32_t duty = (value*reload)/timer_period;
162163

163164
// uint32_t regval = b16toi(duty + b16HALF);
@@ -166,7 +167,7 @@ int up_pwm_servo_set(unsigned channel, uint16_t value)
166167

167168
SET_CHAN_REG(channel, LEDC_LSCH0_DUTY_REG, duty << 4);
168169
/* Set pulse phase 0 */
169-
SET_CHAN_REG(channel, LEDC_LSCH0_HPOINT_REG, 0);
170+
// SET_CHAN_REG(channel, LEDC_LSCH0_HPOINT_REG, 0);
170171
/* Update clock divide and reload to hardware */
171172
SET_CHAN_BITS(channel, LEDC_LSCH0_CONF0_REG, LEDC_PARA_UP_LSCH0);
172173
// might be needed to update the LEDC_TIMERx_PARA_UP register

0 commit comments

Comments
 (0)