| 
 | 
 本帖最后由 彩色笔 于 2018-1-7 23:40 编辑  
 
   打开“gizwits_protocol.h”看看有没有关于NTP网络时间的函数,记住其函数名 例如:“protocolTime_t gizwitsGetNTPTime(void);”  
    然后打开“gizwits_protocol.c” 
    先在变量名处引用“gizwits_product.c”中定义的char NTPHour,NTPMinute;    按如下写法: 
    extern char NTPHour,NTPMinute; 
 
找到该函数 
   protocolTime_t ICACHE_FLASH_ATTR gizwitsGetNTPTime(void) 
{ 
    protocolTime_t tmValue; 
 
    gagentGetNTP((_tm *)&tmValue); 
 
    NTPHour=tmValue.hour;    //将网络时间值传递出来。  
    NTPMinute=tmValue.minute; 
    return tmValue; 
} 
 
 
思路: 
gizwits_product.c 是用户写程序的文件。 
每次定义好定时值后,记着把该值也存到Flash中,这样掉电存储。然后每过一分钟对比一下该值是否与设置值相等,相等则执行相应动作。 
 
 |   
 
 
 
 |