-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcMenuOBD_menu.cpp
44 lines (34 loc) · 1.85 KB
/
tcMenuOBD_menu.cpp
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
/*
The code in this file uses open source libraries provided by thecoderscorner
DO NOT EDIT THIS FILE, IT WILL BE GENERATED EVERY TIME YOU USE THE UI DESIGNER
INSTEAD EITHER PUT CODE IN YOUR SKETCH OR CREATE ANOTHER SOURCE FILE.
All the variables you may need access to are marked extern in this file for easy
use elsewhere.
*/
#include <tcMenu.h>
#include "tcMenuOBD_menu.h"
// Global variable declarations
U8g2GfxMenuConfig gfxConfig;
U8g2MenuRenderer renderer;
// Global Menu Item declarations
const char enumStrSupportedPID_0[] = "BOOST";
const char enumStrSupportedPID_1[] = "COOLANT";
const char* const enumStrSupportedPID[] = { enumStrSupportedPID_0, enumStrSupportedPID_1 };
const EnumMenuInfo minfoSupportedPID = { "SupportedPID", 9, 0xffff, 1, NO_CALLBACK, enumStrSupportedPID };
EnumMenuItem menuSupportedPID(&minfoSupportedPID, 0, NULL);
const AnalogMenuInfo minfoGAUGE4PID = { "GAUGE 4 PID", 8, 0xffff, 134, NO_CALLBACK, 0, 1, "" };
AnalogMenuItem menuGAUGE4PID(&minfoGAUGE4PID, 0, &menuSupportedPID);
const AnalogMenuInfo minfoGAUGE3PID = { "GAUGE 3 PID", 7, 11, 134, NO_CALLBACK, 0, 1, "" };
AnalogMenuItem menuGAUGE3PID(&minfoGAUGE3PID, 0, &menuGAUGE4PID);
const AnalogMenuInfo minfoGAUGE2PID = { "GAUGE 2 PID", 2, 7, 134, NO_CALLBACK, 0, 1, "" };
AnalogMenuItem menuGAUGE2PID(&minfoGAUGE2PID, 0, &menuGAUGE3PID);
const AnalogMenuInfo minfoGAUGE1PID = { "GAUGE 1 PID", 1, 9, 134, NO_CALLBACK, 0, 1, "" };
AnalogMenuItem menuGAUGE1PID(&minfoGAUGE1PID, 0, &menuGAUGE2PID);
const ConnectorLocalInfo applicationInfo = { "tcMenuOBD", "1d88392a-c2dd-4b5d-99a6-7b8d1ae591b5" };
// Set up code
void setupMenu() {
prepareBasicU8x8Config(gfxConfig);
renderer.setGraphicsDevice(&gfx, &gfxConfig);
switches.initialise(ioUsingArduino(), true);
menuMgr.initForUpDownOk(&renderer, &menuGAUGE1PID, ENCODER_UP_PIN, ENCODER_DOWN_PIN, ENCODER_OK_PIN);
}