Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈家乐
jiancetai
Commits
445541be
Commit
445541be
authored
Dec 16, 2025
by
何锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:初版程序完成
parent
9eb3266c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
86 deletions
+95
-86
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+9
-7
Key_user.c
YueJin_test_bench/source/Appliciation/Key_user.c
+27
-28
RTE_GPIO.c
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
+12
-0
RTE_GPIO.h
YueJin_test_bench/source/Appliciation/RTE_GPIO.h
+4
-3
Task.c
YueJin_test_bench/source/Appliciation/Task.c
+25
-0
Task.h
YueJin_test_bench/source/Appliciation/Task.h
+1
-0
app_lsdn.c
YueJin_test_bench/source/Appliciation/app_lsdn.c
+15
-45
init.c
YueJin_test_bench/source/System/init.c
+2
-3
No files found.
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
445541be
...
...
@@ -4573,11 +4573,11 @@ void ONE_KEY_Display(void)
if
(
ONEKEYLongTime
<=
24
)
{
ONEKEYLongTime
++
;
//
ONE_KEY = 0;
ONE_KEY
=
0
;
}
else
{
//
ONE_KEY = 1;
ONE_KEY
=
1
;
ONEKEYFlag
=
0
;
ONEKEYLongTime
=
0
;
}
...
...
@@ -4587,26 +4587,26 @@ void ONE_KEY_Display(void)
ONEKEYDoubleclickTime
++
;
if
(
ONEKEYDoubleclickTime
<=
4
)
{
//
ONE_KEY = 0;
ONE_KEY
=
0
;
}
else
if
(
ONEKEYDoubleclickTime
<=
6
)
{
//
ONE_KEY = 1;
ONE_KEY
=
1
;
}
else
if
(
ONEKEYDoubleclickTime
<=
10
)
{
//
ONE_KEY = 0;
ONE_KEY
=
0
;
}
else
{
//
ONE_KEY = 1;
ONE_KEY
=
1
;
ONEKEYFlag
=
0
;
ONEKEYDoubleclickTime
=
0
;
}
}
else
{
//
ONE_KEY = 1;
ONE_KEY
=
1
;
ONEKEYLongTime
=
0
;
ONEKEYDoubleclickTime
=
0
;
}
...
...
@@ -4627,6 +4627,8 @@ void ONE_KEY_Display(void)
if
(
ZTSVOK_A
&&
ZTSVOK_B
)
{
TFT_LCD_Draw_Bmp
(
5
,
50
,(
uint8_t
*
)
gImage_Alarm_08_Word0X51_Y261
);
ZTSVOK_A
=
0
;
ZTSVOK_B
=
0
;
}
}
...
...
YueJin_test_bench/source/Appliciation/Key_user.c
View file @
445541be
...
...
@@ -16,12 +16,12 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
RotationAlarmFlag
=
0
;
if
(
ABC_OUT
==
1
)
{
RotationAlarmMode
=
1
;
RotationAlarmMode
=
0
;
ABC_OUT
=
0
;
}
else
{
RotationAlarmMode
=
0
;
RotationAlarmMode
=
1
;
ABC_OUT
=
1
;
}
}
...
...
@@ -51,23 +51,16 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent) //上下ACC电
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
// if(RELAY_KEY_MCU == 1)
// {
// RELAY_KEY_MCU = 0;
// }
// else
// {
// RELAY_KEY_MCU = 1;
// }
if
(
Scroll_Wheel
<
100
)
if
(
RELAY_KEY_MCU
==
1
)
{
Scroll_Wheel
++
;
RELAY_KEY_MCU
=
0
;
}
else
{
Scroll_Wheel
=
0
;
RELAY_KEY_MCU
=
1
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
...
...
@@ -84,15 +77,7 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
//长按一键启动
{
// ONEKEYFlag = 1;
if
(
Scroll_Wheel
>
0
)
{
Scroll_Wheel
--
;
}
else
{
Scroll_Wheel
=
100
;
}
ONEKEYFlag
=
1
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
//长按2秒
{
...
...
@@ -115,11 +100,18 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent) //下一步
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
MENU_CHECK_STEP_ADD
(
);
if
(
Scroll_Wheel
<
100
)
{
Scroll_Wheel
++
;
}
else
{
Scroll_Wheel
=
0
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
Key_Mode
=
1
;
//左键
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
...
...
@@ -146,7 +138,7 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
backflag
=
1
;
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
...
...
@@ -161,11 +153,18 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent)
{
if
(
enKeyEvent
==
KEY_EVENT_SHORT_PRESS
)
{
MENU_CHECK_STEP_SUB
();
if
(
Scroll_Wheel
>
0
)
{
Scroll_Wheel
--
;
}
else
{
Scroll_Wheel
=
100
;
}
}
else
if
(
enKeyEvent
==
KEY_EVENT_LONG_PRESS
)
{
Key_Mode
=
2
;
//右键
}
else
if
(
enKeyEvent
==
KEY_EVENT_SUPER_LONG_PRESS
)
{
...
...
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
View file @
445541be
...
...
@@ -114,6 +114,12 @@ void RTE_GPIO_Init(void)
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_2
;
GPIO_Config
(
&
gpio_temp
);
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_10
;
gpio_temp
.
enGPIOPIN
=
GPIO_PIN_2
;
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_10
;
gpio_temp
.
enGPIOPIN
=
GPIO_PIN_6
;
gpio_temp
.
enGPIOMode
=
GPIO_MODE_PORT
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_OUT
;
...
...
@@ -179,6 +185,12 @@ void RTE_GPIO_Init(void)
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_1
;
gpio_temp
.
enGPIOMode
=
GPIO_MODE_PORT
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_IN
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
// queren = 0;
// LINE_OUT_NEG_01 = 1;
// LINE_OUT_NEG_02 = 1;
...
...
YueJin_test_bench/source/Appliciation/RTE_GPIO.h
View file @
445541be
...
...
@@ -5,7 +5,9 @@
#include "TYW_stdint.h"
#include "GPIO.h"
#define LINE_OUT_NEG_09 GPIO_OUT_PORT10_PIN04 //485_RE
#define ONE_KEY GPIO_OUT_PORT00_PIN08 //一键启动
#define ONE_KEY_IN GPIO_OUT_PORT00_PIN07 //一键启动
#define LINE_OUT_NEG_09 GPIO_OUT_PORT10_PIN04 //485_RE
#define ABC_OUT GPIO_OUT_PORT00_PIN04 //ABC轮动报警输出
#define BCDD_MCU GPIO_OUT_PORT10_PIN00 //脚撑
...
...
@@ -36,12 +38,11 @@
#define DCF_Close GPIO_IN_APORT00_PIN09 //电磁阀关
#define DIS_AD GPIO_IN_APORT00_PIN10
#define DISIN GPIO_IN_APORT00_PIN11 //DIS输入
#define TX_OUT GPIO_OUT_PORT00_PIN08 //一线通TX输出
#define ZTS_A GPIO_IN_APORT00_PIN14 //坐桶锁
#define ZTS_B GPIO_IN_APORT00_PIN15 //坐桶锁
#define FanHui GPIO_OUT_PORT10_PIN02 //负控按键1
/* ---------------------旧的-------------------------- */
#define POWER_CTRL_KL15 GPIO_OUT_PORT10_PIN12
#define SW10 GPIO_IN_PORT10_PIN02
...
...
YueJin_test_bench/source/Appliciation/Task.c
View file @
445541be
...
...
@@ -329,6 +329,30 @@ uint8_t ACCONOFF_delay_3s;
uint16_t
ONE_KEY_ONOFF
;
uint16_t
CHECK_Ctrl_delay
=
0
;
uint8_t
ttext
[
5
]
=
{
4
,
5
,
6
,
7
,
8
};
uint8_t
backflag
;
uint8_t
backsettime
;
void
KeyBackServic
(
void
)
{
if
(
backflag
==
1
)
{
if
(
backsettime
<=
15
)
{
FanHui
=
1
;
backsettime
++
;
}
else
{
FanHui
=
0
;
backflag
=
0
;
backsettime
=
0
;
}
}
else
{
FanHui
=
0
;
}
}
void
Sys_Run_Mode_100ms_Tasks_Group
(
void
)
{
// Aima_SLF(1,1,1,1);
...
...
@@ -336,6 +360,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
ONE_KEY_Display
();
RotationAlarm
();
BCDD_MCU_Service
();
KeyBackServic
();
if
(
CHECK_Ctrl_delay
<
200
)
{
CHECK_Ctrl_delay
++
;
...
...
YueJin_test_bench/source/Appliciation/Task.h
View file @
445541be
...
...
@@ -13,6 +13,7 @@ extern uint8_t ACCONOFF_delay_3s;
extern
uint16_t
ONE_KEY_ONOFF
;
extern
uint16_t
CHECK_Ctrl_delay
;
extern
uint8_t
ONEKEYFlag
;
extern
uint8_t
backflag
;
void
Sys_Run_Mode_Pseudo_Real_Time_Tasks
(
void
);
void
Sys_Run_Mode_2ms_Tasks_Group
(
void
);
void
Sys_Run_Mode_5ms_Tasks_Group
(
void
);
...
...
YueJin_test_bench/source/Appliciation/app_lsdn.c
View file @
445541be
...
...
@@ -10,29 +10,9 @@ _AimaDataText Aimadata;
// 假设的GPIO操作函数
void
set_pin_high
(
uint8_t
mode
)
{
// GPIO_DIR_PORT00_PIN08 = 0;
// TX_OUT = 0;
if
(
mode
==
0
)
{
TX_OUT
=
0
;
}
else
{
}
}
void
set_pin_low
(
uint8_t
mode
)
{
// GPIO_DIR_PORT00_PIN08 = 0;
// TX_OUT = 1;
if
(
mode
==
0
)
{
TX_OUT
=
1
;
}
else
{
}
}
void
lsdn_delay_us
(
uint32_t
us
)
{
...
...
@@ -167,48 +147,38 @@ void AIMA_Uart_Send(void)
}
uint8_t
Scroll_Wheel
;
uint8_t
KeySendTime
;
void
Key_Judgment_Service
(
void
)
{
// memset(Aimadata.Msg, 0x00, Aima_Data_Length);
// memset(Aimadata.Msg, 0xFF, Aima_Data_Length);
Aimadata
.
Msg
[
0
]
=
0xFF
;
Aimadata
.
Msg
[
1
]
=
0xFF
;
if
(
Key_Mode
==
1
)
//左键
{
Aimadata
.
Sig
.
media_left_key
=
0x0
1
;
Aimadata
.
Sig
.
media_left_key
=
0x0
0
;
}
else
if
(
Key_Mode
==
2
)
//右键
{
Aimadata
.
Sig
.
media_right_key
=
0x01
;
}
else
if
(
Key_Mode
==
3
)
//中键
{
Aimadata
.
Sig
.
media_middle_key
=
0x01
;
Aimadata
.
Sig
.
media_right_key
=
0x00
;
}
else
if
(
Key_Mode
==
4
)
//向上
else
{
if
(
Scroll_Wheel
<
100
)
{
Scroll_Wheel
++
;
}
else
{
Scroll_Wheel
=
0
;
}
;
}
else
if
(
Key_Mode
==
5
)
if
((
Key_Mode
==
1
)
||
(
Key_Mode
==
2
))
{
if
(
Scroll_Wheel
>
0
)
if
(
KeySendTime
<=
1
0
)
{
Scroll_Wheel
--
;
KeySendTime
++
;
}
else
{
Scroll_Wheel
=
100
;
Key_Mode
=
0
;
KeySendTime
=
0
;
}
}
else
{
;
}
Aimadata
.
Sig
.
media_key_pos
=
Scroll_Wheel
;
}
...
...
YueJin_test_bench/source/System/init.c
View file @
445541be
...
...
@@ -75,7 +75,6 @@ void Sys_Startup_Init(void)
RTE_GPIO_Init
(
);
// GPIO_DIR_PORT00_PIN08 = 1;
// TX_OUT = 0;
ABC_OUT
=
0
;
...
...
@@ -112,8 +111,8 @@ void Sys_Startup_Init(void)
loc_config
.
pfnUARTReadMsgCallBack
=
UART_Put2
;
UART_Init
(
UART_RLIN32
,
&
loc_config
);
RELAY_VBAT_MCU
=
1
;
RELAY_KEY_MCU
=
1
;
//
ONE_KEY = 1;
RELAY_KEY_MCU
=
0
;
ONE_KEY
=
1
;
}
/***********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment