int main()
{
#ifdef DEBUG
debug();
#endif
u32 tmp=0;
Configuration();
deletef("cmd.dat");
creatf("cmd.dat",0,0);
//RTC_Configuration();
RTC_ITConfig(RTC_IT_SEC, ENABLE); //使能中断
RTC_WaitForLastTask();
RTC_ITConfig(RTC_IT_ALR,ENABLE);
RTC_WaitForLastTask();
tmp=RTC_GetCounter();
RTC_WaitForLastTask();
RTC_SetAlarm(tmp + 60); //60S 后RTC报警唤醒
RTC_WaitForLastTask();
while(1)
{
RCC_ClearFlag();
if(count>4000)
{
writef("cmd.dat",GPS,count); //写入SD卡SRAM的数据
GPIO_SetBits(GPIOB, GPIO_Pin_12); //给GPS供电打开
Delay1(1500);
count=0;
}
else
{
GPIO_SetBits(GPIOB, GPIO_Pin_12); //给GPS供电打开
Delay1(1500);
}
USART_ITConfig(USART3,USART_IT_RXNE , ENABLE);
GPSdataformat(); //用串口收到GPS数据,并且写入 SRAM
if (dingwei==0)
{
//PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFE) ; //系统进入STOP模式
//Configuration();
}
}
}
|