コード例 #1
0
int main( void ) {
  Fbw(init);
  Ap(init);
  while (1) {
    if (sys_time_periodic()) {
      Fbw(periodic_task);
      Ap(periodic_task);
    }
    Fbw(event_task);
    Ap(event_task);
  }
  return 0;
}
コード例 #2
0
ファイル: main_chibios.c プロジェクト: OpenUAS/paparazzi
/*
 * PPRZ/FBW thread
 *
 * Call PPRZ FBW periodic and event functions
 */
static void thd_fbw(void *arg)
{
  (void) arg;
  chRegSetThreadName("FBW");

  while (!chThdShouldTerminateX()) {
    Fbw(handle_periodic_tasks);
    Fbw(event_task);
    chThdSleepMicroseconds(500);
  }

  chThdExit(0);
}
コード例 #3
0
static int32_t pprz_thd(void *arg)
{
  /*
     To be compatible with rtos architecture, each of this 4 workers should
     be implemented in differents threads, each of them waiting for job to be done:
     periodic task should sleep, and event task should wait for event
     */
  (void) arg;
  chibios_chRegSetThreadName("pprz big loop");

  while (!chThdShouldTerminate()) {
    Fbw(handle_periodic_tasks);
    Ap(handle_periodic_tasks);
    Fbw(event_task);
    Ap(event_task);
    chibios_chThdSleepMilliseconds(1);
  }

  return 0;
}
コード例 #4
0
ファイル: main.c プロジェクト: manish8886/rtems-paparazzi
rtems_task Init(
  rtems_task_argument ignored
){
#ifndef SERIO_TESTING
  Fbw(init);
  Ap(init);
  while (1) {
	update_bat(12.0);
    Fbw(handle_periodic_tasks);
    Ap(handle_periodic_tasks);
    Fbw(event_task);
    Ap(event_task);
  }
#else
  UART1Init();
  while(1){
	  Ap(event_task);
  }
#endif
  return ;
}
コード例 #5
0
ファイル: main_chibios.c プロジェクト: OpenUAS/paparazzi
/**
 * Main function
 */
int main(void)
{
  // Init
  Fbw(init);
  Ap(init);

  chThdSleepMilliseconds(100);

  // Create threads
  apThdPtr = chThdCreateStatic(wa_thd_ap, sizeof(wa_thd_ap), NORMALPRIO, thd_ap, NULL);
  fbwThdPtr = chThdCreateStatic(wa_thd_fbw, sizeof(wa_thd_fbw), NORMALPRIO, thd_fbw, NULL);

  // Main loop, do nothing
  while (TRUE) {
    chThdSleepMilliseconds(1000);
  }
  return 0;
}
コード例 #6
0
int main(void)
{
  // Init
  sys_time_init();

  // Init ChibiOS
  sdlogOk = chibios_init();

  // Init PPRZ
  Fbw(init);
  Ap(init);

  chibios_chThdSleepMilliseconds(100);

  launch_pprz_thd(&pprz_thd);
  pprzReady = true;
  // Call PPRZ periodic and event functions
  while (TRUE) {
    chibios_chThdSleepMilliseconds(1000);
  }
  return 0;
}