Exemplo n.º 1
0
int MAIN(MAIN_FUNCTION_PARAMETERS) 
{
  // Initialize the HAL and enable interrupts.
  halInit();

  INTERRUPTS_ON();

  SERIAL_INIT();

  PRINT_RESET_INFORMATION();

#ifdef EMBER_AF_PLUGIN_FREE_RTOS
  emberPluginRtosInitAndRunConnectTask();
#else
  initAndRunMainLoop();
#endif

  return 0;
}
Exemplo n.º 2
0
int MAIN(MAIN_FUNCTION_PARAMETERS)
{
  // Let the application and plugins do early initialization.  This function is
  // generated.
  emberAfMain(MAIN_FUNCTION_ARGUMENTS);

  // Initialize the HAL and enable interrupts.
  halInit();
  INTERRUPTS_ON();

  // Initialize the serial ports.
  SERIAL_INIT();

  // Display diagnostic information about the most recent reset.
  PRINT_RESET_INFORMATION();

  // Initialize a task for the application and plugin events and enable idling.
  emAppTask = emberTaskInit(emAppEvents);
  emberTaskEnableIdling(true);

  // Initialize the stack and wait until it finishes.  We do this so that the
  // application doesn't get ahead of the stack.
  emberInit();
  while (!init) {
    halResetWatchdog();
    PROCESS_MANAGEMENT_COMMAND();
  }
  init = false;

  // Initialize the application and plugins.  This function is generated.
  emberAfInit();

  // Run the application loop, which usually never terminates.
  loop();

  return 0;
}