当前位置: 首页 > wzjs >正文

品牌网站源码wordpress的关键词插件

品牌网站源码,wordpress的关键词插件,怎么建公司网站,电子商务的就业方向是什么系统流程 主程序module_task_process轮询所有任务,包括低功耗任务。进入低功耗逻辑:当低功耗使能,且系统空闲时,进入低功耗 空闲判断依据 is_timeout(system_idle_time, 3000),距离最近空闲时间操作3秒如果有事件需要…

系统流程

  1. 主程序module_task_process轮询所有任务,包括低功耗任务。
  2. 进入低功耗逻辑:当低功耗使能,且系统空闲时,进入低功耗
    • 空闲判断依据 is_timeout(system_idle_time, 3000),距离最近空闲时间操作3秒
    • 如果有事件需要延时进入低功耗,则更新空闲时间system_idle_time = get_tick();
    • 例如按键后亮屏,延时键入低功耗。检测到按键时,更新空闲时间。
  3. 低功耗处理system_goto_sleep
    • 计算最近的一次唤醒时间,
    • 然后进入低功耗
    • 到时间唤醒

sleep_notify()计算所有需要低功耗的设备,最近

低功耗

1. 时序系统,时间间隔到了会执行
void module_task_process(void)
{const task_item_t *t;for (t = &task_tbl_start + 1; t < &task_tbl_end; t++) {if  ((get_tick() - *t->timer) >= t->interval) {*t->timer = get_tick();t->handle();}}
}
2. 低功耗任务是正常任务的一种
static void pm_task(void)
{pm_process();
}task_register("pm", pm_task, 0); 
3. 低功耗使能+系统空闲 => 进入低功耗
void pm_process(void)
{if (!pm_watch.enable || !system_is_idle())return;system_goto_sleep();
}
3.1 空闲判断:轮询所有任务的空闲标志位
static bool system_is_idle(void)
{const pm_item_t *it;for (it = &pm_tbl_start + 1; it < &pm_tbl_end; it++) {if (it->idle != NULL && !it->idle())return false;}return true;
}
3.2 轮询所有低功耗任务的sleep_notify,获得最近下次唤醒时间,进入休眠,到时间唤醒。
sleep_notify计算下次唤醒时间,(关闭xx外设)
wakeup_notify (初始化xx外设,执行相应程序)
static void system_goto_sleep(void)
{const pm_item_t   *it;const pm_adapter_t *adt;unsigned int sleep_time;unsigned int tmp;adt = pm_watch.adt;sleep_time = adt->max_sleep_time;//休眠处理for (it = &pm_tbl_start + 1; it < &pm_tbl_end; it++) {if (it->sleep_notify == NULL)continue;tmp = it->sleep_notify();          //休眠请求,并得到设备期待下次唤醒时间if (tmp && tmp < sleep_time)       //计算出所有设备中的最小允许休眠时间sleep_time = tmp;}adt->goto_sleep(sleep_time);		//获得//唤醒处理for (it = &pm_tbl_start + 1; it < &pm_tbl_end; it++) {if (it->wakeup_notify == NULL)continue;it->wakeup_notify();}
}adt->goto_sleep(sleep_time) 指向的目标函数
static unsigned int system_sleep(unsigned int ms)
{    unsigned int start_time = get_tick();/**一般来说进入低功耗应根据sleep_time指定时长使用rtc_wakeup_config配置下一次唤醒时间,这种方式可以让系统休眠时间尽量拉长,功耗也最低。但是对于STM32F4系列MCU来说,低功耗模式下除了RTC其它时钟都是停止的,没有像L4一样拥有低功耗定时器。如果突然外部中断唤醒,系统滴答时钟并不好做补偿处理。故对于F4系列MCU,这里提供一个不需要时间补偿的处理方式,系统只在初始化时配置1次[rtc_wakeup_config],即系统以最小休眠时间为SYS_TICK_INTERVAL(默认10ms)为单位间歇运行.无论系统是否被外部中断唤醒都不会影响系统滴答时钟精度,缺点由于唤醒频繁,比理论极限功耗稍大*/while (get_tick() - start_time < ms) {is_rtc_wakekup = false;PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);if (!is_rtc_wakekup)                              //外部中断唤醒break;}system_wakup_config();                                //启动HSE//printf("Sleep Time:%d isrtc:%d...\r\n\r\n", get_tick() - start_time, is_rtc_wakekup);return get_tick() - start_time;
}

进入低功耗逻辑

基于tick

低功耗任务示例

#define pm_dev_register(name, idle, sleep_notify, wakeup_notify)\
__pm_item_register(name, idle, sleep_notify, wakeup_notify)static unsigned int  key_sleep_notify(void)
{return (key_busy(&key) || readkey()) ? 20 : 0;    /* 非空闲时20ms要唤醒1次*/
} pm_dev_register("key", NULL, key_sleep_notify, NULL);static bool system_is_idle(void)
{return is_timeout(system_idle_time, 3000) && tty.rx_isempty() && tty.tx_isempty();
}pm_dev_register("sys", system_is_idle, NULL, NULL);static unsigned int  led_sleep_notify(void)
{int i;for (i = 0; i < LED_TYPE_MAX; i++)if (blink_dev_busy(&led[i]))return 100;                               //如果有设备活动,最低100ms唤醒1次           return 0;
} pm_dev_register("led", NULL, led_sleep_notify, NULL);

注册低功耗任务

/*** @brief     功耗管理项注册* @param[in] name    - 项目名称* @param[in] idle    - 指示设备是否空闲,如果填NULL,则表示允许系统休眠* @param[in] sleep_notify   - 休眠通知,不需要则填NULL* @param[in] wakeup_notify  - 唤醒通知,不需要则填NULL*/ 
#define pm_dev_register(name, idle, sleep_notify, wakeup_notify)\
__pm_item_register(name, idle, sleep_notify, wakeup_notify)

系统流程图

非空闲
空闲
任务1
任务2
任务N
低功耗任务
it->sleep_notify轮询,获取最近一次唤醒时间
进入低功耗,while最近一次唤醒时间
it->wakeup_notify,执行唤醒任务

不解的地方

  • 关闭外设,让设备休眠放在sleep_notify里?
    应该是的,sleep_notify让xx外设休眠,并计算下次唤醒时间。
    wakeup_notify 让xx外设开启,并执行相应程序。
  • system_goto_sleep里,休眠处理部分for(it = &pm_tbl_start + 1; it < &pm_tbl_end; it++)找到最近执行的唤醒函数,goto_sleep休眠完,直接执行it->wakeup_notify();就可以了,需要再for一次?
  • 所有低功耗外设可以独立进入低功耗?
  • 如果按键改成低功耗,task_register(“key”, key_scan_process, 20); =>pm_dev_register()

文章转载自:

http://KssOxAp6.hghhy.cn
http://DZaLBBYQ.hghhy.cn
http://alxRQO1T.hghhy.cn
http://NAUaZnEJ.hghhy.cn
http://KdXCXk1y.hghhy.cn
http://9MgdonVx.hghhy.cn
http://J7tP5gBm.hghhy.cn
http://5tOLZ8ug.hghhy.cn
http://L9PruRpd.hghhy.cn
http://LI2KYtsL.hghhy.cn
http://l7GgZwEn.hghhy.cn
http://TnheLugb.hghhy.cn
http://5Ngx7udZ.hghhy.cn
http://bCBXve50.hghhy.cn
http://RIjbF7Hi.hghhy.cn
http://i4GISGGa.hghhy.cn
http://vWVkoEfd.hghhy.cn
http://5LvXZVbL.hghhy.cn
http://A4KSiIZd.hghhy.cn
http://e0XTXuGa.hghhy.cn
http://ZMlJy28x.hghhy.cn
http://xy4uatnQ.hghhy.cn
http://vGZp1Nfl.hghhy.cn
http://1ArHMHpq.hghhy.cn
http://vqABMmqk.hghhy.cn
http://bFgjNZGo.hghhy.cn
http://WoTFURFO.hghhy.cn
http://12nZEnoV.hghhy.cn
http://MndhPYJJ.hghhy.cn
http://QFo9yrLt.hghhy.cn
http://www.dtcms.com/wzjs/668031.html

相关文章:

  • 我想在泉州做网站中国建设银行广西分行网站首页
  • 专业建站外包wordpress做的网站扩展性
  • 自己做网站用什么数据库400元做网站送网推
  • 河源东莞网站建设wordpress内网响应慢
  • 厦门网站建设价五金设备网站建设
  • 小程序网站app定制开发湖南网站建设工作室
  • 网站开发 架构网页制作基础教程26页简答题是什么
  • 深圳微商城网站制作报价看书网站排名
  • 商城网站现在可以做么最新企业名录免费
  • 婚庆网站开发潍坊专业输送带产品介绍
  • 如何建立微网站长沙app开发报价
  • 静态网站特点怎样下载上海发布
  • 长春网站建设价格企业速成网站
  • 广州站到广州南站地铁要多久网站改版响应式
  • 没有营业执照怎么样做百度企业网站pc端网站做移动适配
  • 做网站的客户多吗做网站好的书
  • 免费制作网站平台有哪些作网站
  • 网站建设技术合作合同前旗网站开发营销
  • 做网站背景全覆盖的代码南宁广告网页设计招聘信息
  • 社团网站模板免费企业网站报价
  • 在线设计软件网站腾讯外贸电商平台
  • 网站qq链接怎么做新乡市网站建设公司
  • 东莞网站制作建设wordpress适合做什么网站
  • 当今做哪个网站致富wordpress行间距
  • 哪些网站可以做锚文本怎样查网站空间地址
  • 海淀搜索引擎优化seo百度推广整体优化网站
  • 加强检察院门户网站建设手机app开发与应用
  • 网站建设服务 百度罗湖网站建设
  • 工信部怎么查网站备案wordpress island.zip
  • 化妆品网站建设流程图企业展厅 设计 公司