Skip to content

Commit e7d7389

Browse files
committed
Merge branch 'bugfix/fix_pwm_wrong_comment' into 'master'
bugfix(pwm): fix_pwm_wrong_comment See merge request sdk/ESP8266_RTOS_SDK!715
2 parents acd0f23 + 3c3b15f commit e7d7389

File tree

1 file changed

+2
-3
lines changed
  • components/esp8266/driver

1 file changed

+2
-3
lines changed

components/esp8266/driver/pwm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static void pwm_timer_enable(uint8_t enable)
274274
static void IRAM_ATTR pwm_timer_intr_handler(void)
275275
{
276276
//process continous event
277-
uint32_t mask = 0;
277+
uint32_t mask = REG_READ(PERIPHS_GPIO_BASEADDR + GPIO_OUT_ADDRESS);
278278

279279
// In the interrupt handler, first check for data updates, then switch to the updated array at the end of a cycle, start outputting new PWM waveforms, and clear the update flag.
280280
while (1) {
@@ -290,7 +290,6 @@ static void IRAM_ATTR pwm_timer_intr_handler(void)
290290
pwm_obj->run_pwm_toggle = (pwm_obj->run_pwm_toggle ^ 0x1);
291291
pwm_obj->update_done = 0;
292292
}
293-
mask = REG_READ(PERIPHS_GPIO_BASEADDR + GPIO_OUT_ADDRESS);
294293
mask = mask & (~pwm_obj->single->run_pwm_param[pwm_obj->single->run_channel_num - 1].io_clr_mask);
295294
mask = mask | pwm_obj->single->run_pwm_param[pwm_obj->single->run_channel_num - 1].io_set_mask;
296295
REG_WRITE(PERIPHS_GPIO_BASEADDR + GPIO_OUT_ADDRESS, mask);
@@ -316,7 +315,7 @@ static void IRAM_ATTR pwm_timer_intr_handler(void)
316315
}
317316

318317
REG_WRITE(WDEVTSFSW0_LO, 0);
319-
//WARNING, pwm_obj->this_target - AHEAD_TICKS1 should be bigger than 20 (https problem)
318+
//WARNING, pwm_obj->this_target - AHEAD_TICKS1 should be bigger than 2
320319
REG_WRITE(WDEVTSF0_TIMER_LO, pwm_obj->this_target - AHEAD_TICKS1);
321320
REG_WRITE(WDEVTSF0TIMER_ENA, WDEV_TSF0TIMER_ENA);
322321
}

0 commit comments

Comments
 (0)