Skip to content

Instantly share code, notes, and snippets.

@GOROman
Created June 4, 2023 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GOROman/828de3cd48c33e32d5ae0ae010812007 to your computer and use it in GitHub Desktop.
Save GOROman/828de3cd48c33e32d5ae0ae010812007 to your computer and use it in GitHub Desktop.
EdgeTX の起動シーケンス

opentx.cpp:main()

int main()
{
  /* Ensure all priority bits are assigned as preemption priority bits. */
  NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );

  boardInit();

  modulePortInit();
  pulsesInit();

  checkValidMCU();

  tasksStart(); // 🌟
}

tasks.cpp:tasksStart()

void tasksStart()
{
  RTOS_CREATE_MUTEX(audioMutex);

#if defined(CLI) && !defined(SIMU)
  cliStart();
#endif

  mixerTaskInit();

  RTOS_CREATE_TASK(menusTaskId, menusTask, "menus", menusStack,
                   MENUS_STACK_SIZE, MENUS_TASK_PRIO);

#if !defined(SIMU)
  RTOS_CREATE_TASK(audioTaskId, audioTask, "audio", audioStack,
                   AUDIO_STACK_SIZE, AUDIO_TASK_PRIO);
#endif

  RTOS_START();
}
TASK_FUNCTION(menusTask)
{
#if defined(LIBOPENUI)
  LvglWrapper::instance();
#endif

#if defined(SPLASH) && !defined(STARTUP_ANIMATION)
  if (!UNEXPECTED_SHUTDOWN()) {
    drawSplash();
    TRACE("drawSplash() completed");
  }
#endif

#if defined(HARDWARE_TOUCH) && !defined(PCBFLYSKY) && !defined(SIMU)
  touchPanelInit();
#endif

  opentxInit();

opentx.cpp:opentxInit()

void opentxInit()
{
  TRACE("opentxInit");
#if defined(LIBOPENUI)
  // create ViewMain
  ViewMain::instance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment