From 72def895431ad7a08e635b11f3da738e2b2c4618 Mon Sep 17 00:00:00 2001
From: wujiazhi <1147861305@qq.com>
Date: Thu, 13 Jun 2024 11:31:04 +0800
Subject: [PATCH] add lower model test
---
Function/PROJECT_TETS/project_test.c | 79 +++++++++++++++++++++------------------
1 files changed, 43 insertions(+), 36 deletions(-)
diff --git a/Function/PROJECT_TETS/project_test.c b/Function/PROJECT_TETS/project_test.c
index 6af8e9c..7a9a1f7 100644
--- a/Function/PROJECT_TETS/project_test.c
+++ b/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,35 +348,37 @@
void project_test_2(void)
{
IWDT_Clr();
- // 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 �����Ϸ�+�����Ϸ�
+ if (HWID0_READ == 0)
{
- delay_ms(50);
- if (GPIO_ReadInputDataBit(GPIOF, GPIO_Pin_14) == 0) // key3
- {
- printf("Turn_On power 3.3v and send gprs\r\n");
- GPRS_POWER_ON; // 3.8V ʹ������
- GPRS_POWER_EN_H; // ������ģ���Դ
- delay_ms(500);
- IWDT_Clr();
- Gprs_Open();
- //GPRS_Send_process();
- }
+ 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(50);
+ if (GPIO_ReadInputDataBit(GPIOF, GPIO_Pin_14) == 0) // key3
+ {
+ printf("Turn_On power 3.3v and send gprs\r\n");
+ GPRS_POWER_ON; // 3.8V ʹ������
+ GPRS_POWER_EN_H; // ������ģ���Դ
+ delay_ms(500);
+ IWDT_Clr();
+ Gprs_Open();
+ 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();//���˯��
}
}
}
@@ -434,7 +441,7 @@
else if (press_duration >= LONG__LONG_PRESS_TIME) // 9v
{
printf("Long long press detected.\n");
- OUTPUT1_EN_ON;
+ OUTPUT1_EN_ON;
power9V_ON;
BOOST_EN_ON;
}
@@ -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);
}
@@ -729,13 +736,13 @@
}
void Project_Test(void)
{
- project_test_1(); // led ������˸
- project_test_2(); // key3 �����Ϸ� ke2 �̰�����
- project_test_3(); // SEPIC��Դ��� key1 (��������:�̰�12v ����4s 5V ���� 6s 9v)
- project_test_5(); // ���� �����
- project_test_6(); // �ɼ���ѹ mcu �¶� ������
- Project_Test_8(); // ������ ���Ǽӣ��������裩���ɻƼ��
- project_test_10(); // RTC(�ⲿʱ�ӻ�ȡ)
-// project_test_11(); // uart5 uart1ͨ�ż��
- IWDT_Clr();
+ project_test_1(); // led ������˸
+ project_test_2(); // key3 �����Ϸ� ke2 �̰�����
+ project_test_3(); // SEPIC��Դ��� key1 (��������:�̰�12v ����4s 5V ���� 6s 9v)
+ project_test_5(); // ���� �����
+ project_test_6(); // �ɼ���ѹ mcu �¶� ������
+ Project_Test_8(); // ������ ���Ǽӣ��������裩���ɻƼ��
+ project_test_10(); // RTC(�ⲿʱ�ӻ�ȡ)
+ //project_test_11(); // uart5 uart1ͨ�ż��
+ IWDT_Clr();
}
\ No newline at end of file
--
Gitblit v1.9.3