Beispiel #1
0
// This must be the first module to be initialized!
void systemInit(void)
{
  if(isInit)
    return;

  canStartMutex = xSemaphoreCreateMutex();
  xSemaphoreTake(canStartMutex, portMAX_DELAY);

  usblinkInit();
  sysLoadInit();

  /* Initialized hear and early so that DEBUG_PRINT (buffered) can be used early */
  crtpInit();
  consoleInit();

  DEBUG_PRINT("----------------------------\n");
  DEBUG_PRINT(P_NAME " is up and running!\n");
  DEBUG_PRINT("Build %s:%s (%s) %s\n", V_SLOCAL_REVISION,
              V_SREVISION, V_STAG, (V_MODIFIED)?"MODIFIED":"CLEAN");
  DEBUG_PRINT("I am 0x%X%X%X and I have %dKB of flash!\n",
              *((int*)(MCU_ID_ADDRESS+8)), *((int*)(MCU_ID_ADDRESS+4)),
              *((int*)(MCU_ID_ADDRESS+0)), *((short*)(MCU_FLASH_SIZE_ADDRESS)));

  configblockInit();
  workerInit();
  adcInit();
  ledseqInit();
  pmInit();
  buzzerInit();

  isInit = true;
}
Beispiel #2
0
void commInit(void)
{
  if (isInit)
    return;

#ifdef USE_ESKYLINK
  eskylinkInit();
#else
  /* radiolinkInit(); */
#endif

  crtpInit();

#ifdef USE_UART_CRTP
  crtpSetLink(uartGetLink());
#elif defined(USE_ESKYLINK)
  crtpSetLink(eskylinkGetLink());
#else
  crtpSetLink(radiolinkGetLink());
#endif

  crtpserviceInit();
  logInit();
  consoleInit();
  paramInit();

  //setup CRTP communication channel
  //TODO: check for USB first and prefer USB over radio
  //if (usbTest())
  //  crtpSetLink(usbGetLink);
  //else if(radioTest())
  //  crtpSetLink(radioGetLink());

  isInit = true;
}
Beispiel #3
0
void commanderInit(void)
{
  if(isInit)
    return;


  crtpInit();
  crtpRegisterPortCB(CRTP_PORT_COMMANDER, commanderCrtpCB);

  lastUpdate = xTaskGetTickCount();
  isInactive = true;
  isInit = true;
}
void commanderAdvancedInit(void) {
	if (isInit)
		return;

	crtpInit();
	//crtpRegisterPortCB(CRTP_PORT_COMMANDER_ADVANCED, commanderAdvancedCrtpCB);
	crtpRegisterPortCB(CRTP_PORT_COMMANDER, commanderAdvancedCrtpCB);

	lastUpdate = xTaskGetTickCount();
	isInactive = true;
	thrustLocked = true;
	isInit = true;
}
void commanderInit(void)
{
  if(isInit==RT_TRUE)
    return;


  crtpInit();
  crtpRegisterPortCB(CRTP_PORT_COMMANDER, commanderCrtpCB);

  lastUpdate = rt_tick_get();
  isInactive = RT_TRUE; 
  isInit = RT_TRUE;
}
/* Public functions */
void commanderInit(void)
{
  if(isInit) {
    return;
  }

  crtpInit();
  crtpRegisterPortCB(CRTP_PORT_COMMANDER, commanderCrtpCB);

  activeCache = &crtpCache;
  lastUpdate = xTaskGetTickCount();
  isInactive = true;
  thrustLocked = true;
  isInit = true;
}
Beispiel #7
0
/* Public functions */
void commanderInit(void)
{
  if(isInit) {
    return;
  }

  crtpInit();
  crtpRegisterPortCB(CRTP_PORT_SETPOINT, commanderCrtpCB);
  extPositionInit(); // Set callback for CRTP_PORT_POSITION

  activeCache = &crtpCache;
  lastUpdate = xTaskGetTickCount();
  isInactive = true;
  thrustLocked = true;
  isInit = true;
}
void poseCommanderInit(void) {
  if(isInit)
    return;

  crtpInit();
  crtpRegisterPortCB(CRTP_PORT_POSE, poseCommanderCrtpCB); // x, y, z, yaw

  desiredPoses.front = 0;
  desiredPoses.rear = 0;

  xTaskCreate(poseCommanderTask, (const signed char * const)"POSECMD",
              2*configMINIMAL_STACK_SIZE, NULL, /*Piority*/2, NULL);

  lastUpdate = xTaskGetTickCount();
  isInactive = TRUE;
  isInit = TRUE;
}