MCPcopy Create free account
hub / github.com/TailsmanDesign/PocketMage_PDA / processKB

Function processKB

Code/PocketMage_V3/src/PocketMageV3.cpp:70–149  ·  view source on GitHub ↗

ADD PROCESS/KEYBOARD APP SCRIPTS HERE

Source from the content-addressed store, hash-verified

68
69// ADD PROCESS/KEYBOARD APP SCRIPTS HERE
70void processKB() {
71 // Check for USB KB
72 KB().checkUSBKB();
73
74 // Example OTA APP
75 // Displays a progress bar and then reboots to PocketMage OS
76 // Remove this when making a real OTA APP + uncomment processKB_APP();
77 #if OTA_APP
78 static int x = 0;
79 ESP_LOGD(TAG, "OTA APP MODE - PROGRESS: %d\n", x);
80 // Draw a progress bar across the screen and then return to PocketMage OS
81 u8g2.clearBuffer();
82 u8g2.drawBox(0,0,x,u8g2.getDisplayHeight());
83
84 x+=5;
85
86 if (x > u8g2.getDisplayWidth()) {
87 // Return to pocketMage OS
88 rebootToPocketMage();
89 // OTA_APP: reboot method that sets reboot flag instead of direct reboot
90 // pocketmage::checkRebootOTA(); // alternative method for testing OTA_APP rebooting
91 // prefs.begin("PocketMage", false);
92 // prefs.putBool("OTA_Reboot", true);
93 // prefs.end();
94 // pocketmage::deepSleep();
95 }
96
97 u8g2.sendBuffer();
98 delay(10);
99 #if OTA_APP
100 processKB_APP(); // OTA_APP: entry point
101 #endif
102 return;
103 #endif
104 // OTA_APP: Remove switch statement
105 #if !OTA_APP // POCKETMAGE_OS
106 switch (CurrentAppState) {
107 case HOME:
108 processKB_HOME();
109 break;
110 case TXT:
111 processKB_TXT_NEW();
112 break;
113 case FILEWIZ:
114 processKB_FILEWIZ();
115 break;
116 case TASKS:
117 processKB_TASKS();
118 break;
119 case SETTINGS:
120 processKB_settings();
121 break;
122 case USB_APP:
123 processKB_USB();
124 break;
125 case CALENDAR:
126 processKB_CALENDAR();
127 break;

Callers 1

loopFunction · 0.85

Calls 15

rebootToPocketMageFunction · 0.85
processKB_APPFunction · 0.85
processKB_HOMEFunction · 0.85
processKB_TXT_NEWFunction · 0.85
processKB_FILEWIZFunction · 0.85
processKB_TASKSFunction · 0.85
processKB_settingsFunction · 0.85
processKB_USBFunction · 0.85
processKB_CALENDARFunction · 0.85
processKB_LEXICONFunction · 0.85
processKB_JOURNALFunction · 0.85
processKB_APPLOADERFunction · 0.85

Tested by

no test coverage detected