-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu.c
67 lines (63 loc) · 1.27 KB
/
menu.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include"common.h"
#include"App.h"
#include"comx.h"
typedef void(*V_FP_V)(void);
void show(int Choose)
{
switch (Choose)
{
default:printf("fatal error!!!\n");
CASE MainMenu :
printf("欢迎使用多功能串口调试助手(By 海魂水晶)\n"\
"请在使用前阅读说明文档\n"\
"1.超级终端\n"\
"2.接收大量数据\n"\
"3.蓝牙AT模式设置\n"\
"4.根据数据导出图片\n"\
"Q.退出程序\n"
);
CASE SetATMenu :
printf("请先接好线路,确认无误后继续\n");
system("pause");
system("cls");
printf("请选择芯片型号\n1.HC-05\t2.HC-06\nQ.退出当前任务\n");
CASE ExportPictureMenu :
printf("请选择数据种类\n1.图片\n2.PID测试\nQ.退出当前任务\n");
}
}
void Menu(int Choose, int Num)
{
static V_FP_V const arpf[][9] =
{
{ HyperTerminal, ReceivePicture, SetAT, ExportPicture },
{ Set05AT, Set06AT },
{ ExPic, PIDtest }
};
int option = 0;
show(Choose);
while (1)
{
option = _getch();
if (option > Num + 48 || option < '1')
{
if (option == 'Q' || option == 'q')
{
break;
}
else
{
printf("数据错误,请重新输入!\n");
continue;
}
}
option -= 49;
system("cls");
arpf[Choose][option]();
system("pause");
system("cls");
show(Choose);
}
}