Commit 383b3337 authored by 何锐's avatar 何锐

feat:增加光感检测显示

parent 8a955c56
......@@ -4845,6 +4845,30 @@ void Display_flag(uint8_t Check_Steps)
break;
}
}
uint8_t LightOutLast;
void LightOutServe(void)
{
uint8_t LightOutHigh[4] = {71,65,79,0xff};
uint8_t LightOutDi[3] = {68,73,0xff};
if(guangganmondel)
{
if(guanggan != LightOutLast)
{
Display_TFT_Clear();
}
if(guanggan)
{
General_Number_Disp(LightOutHigh, 3, 90+30);
}
else
{
General_Number_Disp(LightOutDi, 3, 90+30);
}
LightOutLast = guanggan;
}
}
void Page_Num_Display(uint8_t page)
{
......
......@@ -107,6 +107,7 @@ extern uint32_t loc_Current_0;
extern void Get_static_Current(void);
extern uint32_t Get_Display_Type(void);
extern void Display_Num(uint16_t StartX, uint16_t StartY,uint16_t m_NUM,uint8_t CbkCycle);
extern void LightOutServe(void);
extern const uint8_t *Num_15[];
typedef struct {
uint8_t going[5];
......
......@@ -160,5 +160,6 @@ extern uint8_t Study_Flag;
extern uint8_t Require_card_flag;
extern uint8_t writeflag;
extern uint8_t uidwriteStep;
extern uint8_t guangganmondel;
#endif
......@@ -102,10 +102,12 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent)
{
}
}
uint8_t guangganmondel = 0;
void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
{
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{
guangganmondel = 0;
check_Control_Mode2_Flag = 0;
Display_SUCCESS_Clear();
if(UIDMondel == 0)
......@@ -184,10 +186,23 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
change = 17;
UUIDX = 170;
}
guangganmondel = 0;
}
}
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{
UIDMondel = 0;
memset(&All_Flag, 0, sizeof(All_Flag));
All_Flag.u8flag[2] = 1;
Display_TFT_Clear();
if(guangganmondel)
{
guangganmondel = 0;
}
else
{
guangganmondel = 1;
}
}
else
{
......
......@@ -71,6 +71,13 @@ void RTE_GPIO_Init(void)
GPIO_Init(GPIO_WAKEUP_MODE);
// gpio_temp.enGPIOPort = GPIO_PORT_GROUP_8;//光感输入
// gpio_temp.enGPIOPIN = GPIO_PIN_12;
// gpio_temp.enGPIOMode = GPIO_MODE_PORT;
// gpio_temp.enGPIODir = GPIO_DIR_IN;
// gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
// GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_AP0;
gpio_temp.enGPIOPIN = GPIO_PIN_14;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
......@@ -120,6 +127,12 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_9;
gpio_temp.enGPIOPIN = GPIO_PIN_1;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
gpio_temp.enGPIODir = GPIO_DIR_OUT;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_9;
gpio_temp.enGPIOPIN = GPIO_PIN_4;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
gpio_temp.enGPIODir = GPIO_DIR_OUT;
......
......@@ -119,7 +119,7 @@
#define LINE_FUEL_RES03 GPIO_OUT_PORT08_PIN10
#define LINE_FUEL_RES04 GPIO_OUT_PORT08_PIN11 //左转 输入
#define LINE_FUEL_RES02 GPIO_OUT_PORT08_PIN12 //右转 输入
#define guanggan GPIO_IN_PORT08_PIN12 //右转 输入
#define GPIO_VSpeed_PWM_IN GPIO_IN_PORT10_PIN15
......
......@@ -147,6 +147,8 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
{
UIDDisplay();
}
LightOutServe();
}
/*=================================================================*/
......
......@@ -96,6 +96,7 @@ void Sys_Startup_Init(void)
loc_config.pfnUARTErrHandleCallBack = 0;
loc_config.pfnUARTReadMsgCallBack = UART_Put;
UART_Init(UART_RLIN30, &loc_config);
LINE_OUT_NEG_06 = 1;
// loc_config.enUARTLINMode = MODE_UART;
// loc_config.u32UARTbps = 9600;
// loc_config.enUARTOrder = UART_LSB;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment