My final year project
Dependencies: BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem TS_DISCO_F746NG ResistiveTouchController Map CYS8218Controller MedianFilter
Diff: main.cpp
- Revision:
- 1:43fb2d03c36f
- Parent:
- 0:1523395daf0d
- Child:
- 2:5fded6444350
--- a/main.cpp Sat Oct 01 19:02:49 2016 +0000 +++ b/main.cpp Sat Oct 01 22:43:20 2016 +0200 @@ -0,0 +1,53 @@ +#include "mbed.h" +#include "Screens.hpp" + + +void GUIThread(); +void Init(); + +int currentScreen = 0; +int nextScreen = 0; +Thread guiThread; +Screen *activeScreen = NULL; + +int main() +{ + Init(); + + while(1) + { + // TODO Add hardware logic + } +} + +void GUIThread() +{ + while(1) + { + if( nextScreen != currentScreen ) + { + if( activeScreen != NULL) + delete activeScreen; + + switch (nextScreen) + { + case MAIN_MENU_SCREEN: + activeScreen = new MainMenuScreen(&nextScreen); + break; + } + + activeScreen->Draw(); + Thread::wait(200); + } + + activeScreen->Process(); + + Thread::wait(20); + } +} + +void Init() +{ + nextScreen = Screens::MAIN_SCREEN; + guiThread.start(GUIThread); +}