sleep.c 738 B

123456789101112131415161718192021222324252627
  1. #include "includes.h"
  2. //进入低功耗会死机,暂时使用以下操作模拟。20mA~30mA左右
  3. void Sleeping(void)
  4. {
  5. SlwTrace(INF, "Sleeping",1);
  6. MODEM_LED1_LOW;
  7. MODEM_LED2_LOW;
  8. SpeakerDisable();
  9. MicDisable();
  10. MODEM_RESET_HIGH;
  11. MODEM_PWRKEY_LOW;
  12. GPS_PWR_OFF;
  13. IWDG_Configuration(3000);
  14. RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC, DISABLE);
  15. RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2 | RCC_APB1Periph_USART3, DISABLE);
  16. ADC_Cmd (ADC1,DISABLE);//使能或者失能指定的ADC
  17. RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, DISABLE);
  18. os_tsk_delete(idModemUartTask);
  19. os_tsk_delete(idModemTask);
  20. os_tsk_delete(idTTSTask);
  21. while(1)
  22. {
  23. os_dly_wait(1000);
  24. IWDG_ReloadCounter();
  25. }
  26. }