可是每次加上状态判断,网络调试助手都检测不到发来的数据了~~不知道是哪里逻辑写的不对
//========================================
//定时器中断服务函数
//========================================
void time0_isr(void) interrupt 1 //定时器0中断服务程序
{
TL0 = T1MS; //重载
TH0 = T1MS>>8;
if(Time0_Count<=3000) //每三秒钟刷新数据
{
Time0_Count++;
sendflag = 0;
}
else
{
Time0_Count = 0;
speed = (count - speed_count)*20; //计算输液速度: xx滴/每分钟
speed_count = count;
int2char(speed, 4,&speed_send);
//send_package();
sendflag = 1;
if(WiFi_ck == 1&&WiFi_LED == 1) //WiFi状态查询
{
MODE = MODE_ON;
}
else if(WiFi_ck ==0||WiFi_LED == 0)
{
MODE = MODE_OFF;
}
if(sendflag == 1)
{
switch(MODE)
{
case MODE_ON:
send_package();
case MODE_OFF:
e2prom_write(0x01,3);
}
}
}
------解决思路----------------------
没看代码, WIFI模块供电不都是要求1A,2A的么? 你用的电池驱动得了?