ESP8266--硬件定时器(SDK RTOS 2.0)

文件在:

esp8266-rtos-sdk/driver_lib/driver/hw_timer.c

使用起来相当简单:

hw_timer_init(1);
hw_timer_set_func(hw_test_timer_cb); // 注册定时器回调函数
hw_timer_arm(1000000);  // 1秒

1、硬件定时器初始化

  • 参数:0:不自动加载;1:自动加载
void hw_timer_init(uint8 req);

总结:

如果设置为:1000000,那么会每1秒钟进入定时器中断处理函数中一次

hw_timer_arm(1000000);

猜你喜欢

转载自blog.csdn.net/qq_28877125/article/details/80059389