forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

wujiazhi
2024-06-13 72def895431ad7a08e635b11f3da738e2b2c4618
Function/PROJECT_TETS/project_test.c
@@ -9,6 +9,8 @@
#include "ir_nec.h"
#include "gprs_module_api.h"
#include "1lcd_new.h"
#include "1powermanage.h"
volatile uint32_t msTicks = 0;
volatile uint32_t get_time = 0;
@@ -32,6 +34,8 @@
  while (Sys_GetTick() < start_time + ms)
    ; // Ñ­»·µÈ´ý
}
#if Debug_Model
void AppNvr_Print(void)
{
  CMU_ClocksType CMU_Clocks;
@@ -52,6 +56,7 @@
     ; // µÈ´ý·¢ËÍÍê³É
   return ch;
 }
#endif
void Timer_Init(uint32_t psc, uint32_t arr_value)
{
@@ -343,14 +348,14 @@
void project_test_2(void)
{
  IWDT_Clr();
  // if (HWID0_READ == 0)
  // {
  //   EX_PWR_EN_H;
  // }
  // else
  // {
  //   EX_PWR_EN_L;
  // }
  if (HWID0_READ == 0)
  {
    EX_PWR_EN_H;
  }
  else
  {
    EX_PWR_EN_L;
   }
   Gprs_Uart1_Rx_DMA_CH3_Check();
   Gprs_Uart1_Receive_Data();
  if ((GPIO_ReadInputDataBit(GPIOF, GPIO_Pin_14) == 0) || (GPIO_ReadInputDataBit(GPIOF, GPIO_Pin_15) == 0)) // ¶Ì°´ key3 ÎÞÏßÉÏ·¢+ÎÞÏßÉÏ·¢
@@ -364,14 +369,16 @@
      delay_ms(500);
      IWDT_Clr();
      Gprs_Open();
      //GPRS_Send_process();
      GPRS_Send_process();
    }
    if (GPIO_ReadInputDataBit(GPIOF, GPIO_Pin_15) == 0) // key2 ¶Ï°´½øÈëµÍ¹¦ºÄ
    {
      //printf("lower model \r\n");
      BSTIM_CR1_CEN_Setable(DISABLE);
      delay_ms(50);
      LCD_3V3_OFF;
      GPIO_IPD_Init();
      pwr_enter_sleep_mode((uint32)(PMU_CR_SLPDP_DEEPSLEEP));
      printf("lower model \r\n");
      Deep_sleep_mode();//Éî¶È˯Ãß
    }
  }
}
@@ -607,8 +614,8 @@
  uint32_t total_ticks = msTicks * arr_value;
  float measured_frequency = (float)total_ticks * psc;
  float error_percentage = ((measured_frequency - SYS_CLOCK_HZ) / SYS_CLOCK_HZ) * 100;
  printf("Measured Frequency: %.2f Hz\r\n", measured_frequency);
  printf("Error Percentage: %.2f%%\r\n", error_percentage);
  //printf("Measured Frequency: %.2f Hz\r\n", measured_frequency);
  //printf("Error Percentage: %.2f%%\r\n", error_percentage);
  BSTIM_CR1_CEN_Setable(ENABLE);
}