esp8266 hw_timer

Aires
Posts: 2
Joined: Tue Jul 11, 2017 5:26 am

esp8266 hw_timer

Postby Aires » Wed Feb 07, 2018 8:34 pm

Hello people. I love esp8266, this great congratulations. But I need help with hw_timer.
The "OLED__Print" routine takes a long time and "hw_timer" does not interrupt it as described in the manual, so my PWM dimmer in "Set_Dim_handler" failed to second by second. There is some way to solve this. Thank you.

hw_timer_set_func(Set_Dim_handler);
hw_timer_init(NMI_SOURCE, 1);
hw_timer_arm(2000);

os_timer_disarm(&ntp_timer);
os_timer_setfn(&ntp_timer,ntp_time_update,NULL);
os_timer_arm(&ntp_timer,1000,1);

;********************************************************
void Set_Dim_handler(void) {
Put_OUTPUT(Canal_1_Pin,1);
os_delay_us(15);
Put_OUTPUT(Canal_1_Pin,0);
Corrent_T = Pwm_Luz[1].T1;
RTC_REG_WRITE(FRC1_LOAD_ADDRESS, Corrent_T);
}
void ICACHE_FLASH_ATTR ntp_time_update(void *ignored){
sntp_time++;
os_sprintf(TFT_Data , "%02d:%02d.%02d",_hour,_min,_sec);
OLED__Print(13, 0, TFT_Data,1);
}

Who is online

Users browsing this forum: No registered users and 1 guest