kopia lustrzana https://github.com/OpenRTX/OpenRTX
Made the main() thread run the UI task, thus removing the need for a dedicated one
rodzic
5b44cb9a9f
commit
01ea1a9b3f
|
@ -28,13 +28,6 @@
|
|||
*/
|
||||
void create_threads();
|
||||
|
||||
// #ifdef __arm__
|
||||
|
||||
/**
|
||||
* Stack size for UI task, in bytes.
|
||||
*/
|
||||
#define UI_TASK_STKSIZE 2048
|
||||
|
||||
/**
|
||||
* Stack size for Keyboard task, in bytes.
|
||||
*/
|
||||
|
@ -55,30 +48,4 @@ void create_threads();
|
|||
*/
|
||||
#define GPS_TASK_STKSIZE 2048
|
||||
|
||||
// #else /* __arm__ */
|
||||
//
|
||||
// #define UI_TASK_STKSIZE 4096
|
||||
//
|
||||
// /**
|
||||
// * Stack size for Keyboard task, in bytes.
|
||||
// */
|
||||
// #define KBD_TASK_STKSIZE 256
|
||||
//
|
||||
// /**
|
||||
// * Stack size for device update task, in bytes.
|
||||
// */
|
||||
// #define DEV_TASK_STKSIZE 1024
|
||||
//
|
||||
// /**
|
||||
// * Stack size for baseband control task, in bytes.
|
||||
// */
|
||||
// #define RTX_TASK_STKSIZE 1024
|
||||
//
|
||||
// /**
|
||||
// * Stack size for GPS task, in bytes.
|
||||
// */
|
||||
// #define GPS_TASK_STKSIZE 1024
|
||||
//
|
||||
// #endif /* __arm__ */
|
||||
|
||||
#endif /* THREADS_H */
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <interfaces/delays.h>
|
||||
#include <hwconfig.h>
|
||||
|
||||
extern void *ui_task(void *arg);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
// Initialize platform drivers
|
||||
|
@ -35,6 +37,7 @@ int main(void)
|
|||
|
||||
// Initialize display and graphics driver
|
||||
gfx_init();
|
||||
|
||||
// Set default contrast
|
||||
display_setContrast(default_settings.contrast);
|
||||
|
||||
|
@ -55,10 +58,6 @@ int main(void)
|
|||
// Create OpenRTX threads
|
||||
create_threads();
|
||||
|
||||
// Auxiliary functions loop
|
||||
while(true)
|
||||
{
|
||||
// No low-frequency function at the moment
|
||||
;
|
||||
}
|
||||
// Jump to the UI task
|
||||
ui_task(NULL);
|
||||
}
|
||||
|
|
|
@ -337,14 +337,6 @@ void create_threads()
|
|||
|
||||
pthread_create(&rtx_thread, &rtx_attr, rtx_task, NULL);
|
||||
|
||||
// Create UI thread
|
||||
pthread_t ui_thread;
|
||||
pthread_attr_t ui_attr;
|
||||
|
||||
pthread_attr_init(&ui_attr);
|
||||
pthread_attr_setstacksize(&ui_attr, UI_TASK_STKSIZE);
|
||||
pthread_create(&ui_thread, &ui_attr, ui_task, NULL);
|
||||
|
||||
// Create Keyboard thread
|
||||
pthread_t kbd_thread;
|
||||
pthread_attr_t kbd_attr;
|
||||
|
|
Ładowanie…
Reference in New Issue