Running Sparklet over RTOS

In case an RTOS is used, create a high priority task for Sparklet with required stack size. Running it as a high priority will keep the UI responsive. For example, in FreeRTOS, a task for Sparklet with the given stack size and priority can be created similar to the following example snippet:

 1#define  configMINIMAL_STACK_SIZE      200
 2#define  configMAX_PRIORITIES                5
 3TaskHandle_t sparklet_task_handle;
 4xTaskCreate((TaskFunction_t)rt1170_gpu_rx_task,               /* pointer to the task  */
 5(char const *)"rt1170_gpu_task",                             /* task name for kernel awareness debugging */
 6configMINIMAL_STACK_SIZE + 2000,                            /* task stack size   */
 7NULL,                                                      /* optional task startup argument  */
 8configMAX_PRIORITIES - 2,                                 /* initial priority   */
 9NULL                                                     /* optional task handle to create   */
10);

The function sparklet_task() should include all core APIs and the following is an example snippet

 1void sparklet_task ()
 2{
 3//Initialize the SGUI
 4     shal_init_signal();
 5     sgui_init ();
 6     sgui_event_manager_init ();
 7     rs_exec_init ();
 8     sgui_screens_init ();
 9     sgui_sparklet_enable(1);
10     while (1)
11      {
12             sgui_process ();
13             rs_exec_process();
14      }
15}