-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspiffs.h
More file actions
72 lines (62 loc) · 2.16 KB
/
Copy pathspiffs.h
File metadata and controls
72 lines (62 loc) · 2.16 KB
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
68
69
70
71
72
#ifndef CONFETTI_SPIFFS
#define CONFETTI_SPIFFS
uint16_t current_file_list_selection = 0;
char current_working_directory[256] = "/";
void updateSPIFFSUI() {
ttgo->tft->setTextFont(2);
ttgo->tft->drawString(current_working_directory, 0, 32);
for (uint8_t i = 0; i < 10; i++) {
ttgo->tft->setTextColor(
(i == current_file_list_selection? TFT_BLACK : TFT_WHITE),
(i == current_file_list_selection? TFT_WHITE : TFT_BLACK)
);
ttgo->tft->fillRect(0, 48 + i*16, 240, 16, TFT_BLACK);
ttgo->tft->drawBitmap(0, 48 + i*16, (i%2? FOLDER_16 : FILE_16), 16, 16, TFT_WHITE);
ttgo->tft->drawString(i%2? "Folder" : "File", 16, 48 + i*16);
}
ttgo->tft->drawBitmap(30-12, 240-24, EXIT_24, 24, 24, TFT_WHITE);
ttgo->tft->drawBitmap(90-12, 240-24, LEFT_BUTTON_24, 24, 24, TFT_WHITE);
ttgo->tft->drawBitmap(150-12, 240-24, RIGHT_BUTTON_24, 24, 24, TFT_WHITE);
ttgo->tft->drawBitmap(210-12, 240-24, DIAMOND_24, 24, 24, TFT_WHITE);
}
void enterSPIFFSScreen() {
clearMainUI();
updateTitleUI("SPIFFS File Manager");
updateSPIFFSUI();
int16_t x, y;
uint8_t target = 0;
while (true) {
waitTouchDown(x, y);
waitTouchUp(x, y);
// Back button.
if (X_IN_FIRST_QUARTER(x) && y > 240-32) {
current_menu_selection = CLOCK;
break;
}
// up button.
else if (X_IN_SECOND_QUARTER(x) && y > 240-32) {
/*
current_menu_selection -= 1;
if (current_menu_selection == 0) { current_menu_selection = MAXIMUM_ID-1; }
updateMenuBound();
updateMenuUI();
*/
}
// down button.
else if (X_IN_THIRD_QUARTER(x) && y > 240-32) {
/*
current_menu_selection += 1;
if (current_menu_selection >= MAXIMUM_ID) { current_menu_selection = 1; }
updateMenuBound();
updateMenuUI();
*/
}
// select button.
else if (X_IN_FOURTH_QUARTER(x) && y > 240-32) {
// TODO: finish this.
break;
}
}
clearMainUI();
}
#endif