| | |
| | | #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; |
| | |
| | | while (Sys_GetTick() < start_time + ms) |
| | | ; // Ñ»·µÈ´ý |
| | | } |
| | | #if Debug_Model |
| | | |
| | | void AppNvr_Print(void) |
| | | { |
| | | CMU_ClocksType CMU_Clocks; |
| | |
| | | ; // µÈ´ý·¢ËÍÍê³É |
| | | return ch; |
| | | } |
| | | #endif |
| | | |
| | | void Timer_Init(uint32_t psc, uint32_t arr_value) |
| | | { |
| | |
| | | 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 ÎÞÏßÉÏ·¢+ÎÞÏßÉÏ·¢ |
| | |
| | | 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();//Éî¶È˯Ãß |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |