|
8 | 8 | #include <backtrace_saver.hpp>
|
9 | 9 | #include <backtrace.hpp>
|
10 | 10 |
|
| 11 | +#include <Arduino.h> |
| 12 | + |
| 13 | +SET_LOOP_TASK_STACK_SIZE(8 * 1024); |
| 14 | + |
11 | 15 | #endif
|
12 | 16 |
|
13 | 17 | #include <unistd.h>
|
@@ -141,67 +145,6 @@ void mainLoop(void* data) {
|
141 | 145 |
|
142 | 146 | StandbyMode::wait();
|
143 | 147 | }
|
144 |
| -/* |
145 |
| - // Main loop |
146 |
| - while (true) { |
147 |
| - // Update inputs |
148 |
| - hardware::input::update(); |
149 |
| - std::cout << "Update inputs" << std::endl; |
150 |
| -
|
151 |
| - // Update running apps |
152 |
| - AppManager::update(); |
153 |
| -
|
154 |
| - // Don't show anything |
155 |
| - if (libsystem::getDeviceMode() == libsystem::SLEEP) { |
156 |
| - if (getButtonDown(hardware::input::HOME)) { |
157 |
| - setDeviceMode(libsystem::NORMAL); |
158 |
| - } |
159 |
| -
|
160 |
| - continue; |
161 |
| - } |
162 |
| -
|
163 |
| - if (AppManager::isAnyVisibleApp()) { |
164 |
| - if (getButtonDown(hardware::input::HOME)) { |
165 |
| - AppManager::quitApp(); |
166 |
| - } |
167 |
| - } else { |
168 |
| - // If home button pressed on the launcher |
169 |
| - // Put the device in sleep |
170 |
| - if (getButtonDown(hardware::input::HOME)) { |
171 |
| - // Free the launcher resources |
172 |
| - applications::launcher::free(); |
173 |
| -
|
174 |
| - setDeviceMode(libsystem::SLEEP); |
175 |
| - continue; |
176 |
| - } |
177 |
| -
|
178 |
| - std::cout << "Update launcher" << std::endl; |
179 |
| -
|
180 |
| - // Update, show and allocate launcher |
181 |
| - applications::launcher::update(); |
182 |
| -
|
183 |
| - // Icons interactions |
184 |
| - if (applications::launcher::iconTouched()) { |
185 |
| - const std::shared_ptr<AppManager::App> app = applications::launcher::getApp(); |
186 |
| -
|
187 |
| - // Free the launcher resources |
188 |
| - applications::launcher::free(); |
189 |
| -
|
190 |
| - // Launch the app |
191 |
| - try { |
192 |
| - app->run(false); |
193 |
| - } catch (std::runtime_error& e) { |
194 |
| - std::cerr << "Erreur: " << e.what() << std::endl; |
195 |
| - // Affichage du msg d'erreur |
196 |
| - guiManager.showErrorMessage(e.what()); |
197 |
| - // on kill l'application ?!? |
198 |
| - //AppManager::appList[i].kill(); |
199 |
| - } |
200 |
| - } |
201 |
| - } |
202 |
| -
|
203 |
| - AppManager::loop(); |
204 |
| - }*/ |
205 | 148 | }
|
206 | 149 |
|
207 | 150 | void setup()
|
@@ -330,13 +273,7 @@ void setup()
|
330 | 273 | */
|
331 | 274 | AppManager::init();
|
332 | 275 |
|
333 |
| - #ifdef ESP_PLATFORM |
334 |
| - // // stack size: >32k = crash due to image decoder in stack |
335 |
| - xTaskCreateUniversal(mainLoop,"newloop", 16*1024, NULL, 1, NULL, ARDUINO_RUNNING_CORE); |
336 |
| - vTaskDelete(NULL); |
337 |
| - #else |
338 | 276 | mainLoop(NULL);
|
339 |
| - #endif |
340 | 277 | }
|
341 | 278 |
|
342 | 279 | void loop(){}
|
|
0 commit comments