示例#1
0
文件: main.c 项目: victor-zheng/BLE
/*
 *  ======== main ========
 */
int main()
{
  PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
    
    /* Initialize ICall module */
    ICall_init();
  
    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();
    
    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
    
    /* Kick off application - Priority 1 */
    SimpleBLEBroadcaster_createTask();

    BIOS_start();     /* enable interrupts and start SYS/BIOS */
    
    return 0;
}
/*******************************************************************************
 * @fn          Main
 *
 * @brief       Application Main
 *
 * input parameters
 *
 * @param       None.
 *
 * output parameters
 *
 * @param       None.
 *
 * @return      None.
 */
int main()
{
  /* Register Application callback to trap asserts raised in the Stack */
  RegisterAssertCback(AssertHandler);

  PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
  /* Set constraints for Standby, powerdown and idle mode */
  Power_setConstraint  (PowerCC26XX_SB_DISALLOW);
  Power_setConstraint  (PowerCC26XX_IDLE_PD_DISALLOW);
#endif //POWER_SAVING

  /* Initialize ICall module */
  ICall_init();

  /* Start tasks of external images - Priority 5 */
  ICall_createRemoteTasks();

  /* Kick off profile - Priority 3 */
  GAPRole_createTask();

  /* Kick off application - Priority 1 */
  CyclingSensor_createTask();

  /* enable interrupts and start SYS/BIOS */
  BIOS_start();

  return 0;
}
示例#3
0
文件: main.c 项目: victor-zheng/BLE
/*
 *  ======== main ========
 */
int main()
{
  PIN_init(BoardGpioInitTable);

  //enable iCache prefetching
   VIMSConfigure(VIMS_BASE, TRUE, TRUE);
   
   // Enable cache
   VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint  (Power_SB_DISALLOW);
    Power_setConstraint  (Power_IDLE_PD_DISALLOW);
#endif //POWER_SAVING

    /* Initialize ICall module */
    ICall_init();

    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();

    /* Kick off profile - Priority 3 */
    GAPRole_createTask();

    /* Kick off application - Priority 1 */
    ProximityTag_createTask();

    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
    
    return 0;
}
/*
 *  ======== main ========
 */
int main()
{
  PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING

    /* Initialize ICall module */
    ICall_init();

    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();

#ifdef PRINTF_ENABLED
    // Enable System_printf(..) UART output
    UART_Params uartParams;
    UART_Params_init(&uartParams);
    uartParams.baudRate = 921600;
    UartPrintf_init(UART_open(Board_UART, &uartParams));
#endif
    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
    
    SimpleBLEPeripheral_createTask();

#ifdef FEATURE_OAD
    {
      uint8_t counter;
      uint32_t *vectorTable =  (uint32_t*) 0x20000000;
#if defined(__IAR_SYSTEMS_ICC__)
      uint32_t *flashVectors = &__vector_table;
#elif defined(__TI_COMPILER_VERSION__)
      uint32_t *flashVectors = &ti_sysbios_family_arm_m3_Hwi_resetVectors;
#endif //Compiler.
      
      // Write image specific interrupt vectors into RAM vector table.
      for(counter = 0; counter < 15; ++counter)
      {
        *vectorTable++ = *flashVectors++;
      }
    }
#endif //FEATURE_OAD
    
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
    
    return 0;
}
/*******************************************************************************
 * @fn          Main
 *
 * @brief       Application Main
 *
 * input parameters
 *
 * @param       None.
 *
 * output parameters
 *
 * @param       None.
 *
 * @return      None.
 */
int main()
{
#ifdef CACHE_AS_RAM
  // Invalidate cache
  VIMSModeSet( VIMS_BASE, VIMS_MODE_DISABLED );
  // Wait for disabling to be complete
  while ( VIMSModeGet( VIMS_BASE ) != VIMS_MODE_DISABLED );  
  // retain cache during standby
  Power_setConstraint(PowerCC26XX_SB_VIMS_CACHE_RETAIN);
#endif  
  
  RegisterAssertCback(AssertHandler);
  
  PIN_init(BoardGpioInitTable);
  
#ifndef POWER_SAVING
  /* Set constraints for Standby, powerdown and idle mode */
  Power_setConstraint(PowerCC26XX_SB_DISALLOW);
  Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
#endif //POWER_SAVING
  

#ifdef PRINTF_ENABLED
  // Enable System_printf(..) UART output
    UART_Params uartParams;
    UART_Params_init(&uartParams);
    uartParams.baudRate = 1000000;
    UartPrintf_init(UART_open(Board_UART, &uartParams));

    System_printf("Printf enabled\r\n");
#endif
  /* Initialize ICall module */
  ICall_init();
  
  /* Start tasks of external images - Priority 5 */
  ICall_createRemoteTasks();
  
  /* Kick off profile - Priority 3 */
  GAPRole_createTask();
  
  Keys_createTask();

  /* Kick off application - Priority 1 */
  SimpleTopology_createTask();
  

  /* enable interrupts and start SYS/BIOS */
  BIOS_start();
  
  return 0;
}
示例#6
0
文件: main.c 项目: adamcatley/nanoARC
/*
 *  ======== main ========
 */
Void main()
{
  PIN_init(BoardGpioInitTable);

  //enable iCache prefetching
   VIMSConfigure(VIMS_BASE, TRUE, TRUE);
   
   // Enable cache
   VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
    
    /* Initialize ICall module */
    ICall_init();

    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();
    
    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
    
    nanoARCApplication_createTask();

#ifdef FEATURE_OAD_BIM
    {
      uint8_t counter;
      uint32_t *vectorTable =  (uint32_t*) 0x20000000;
      uint32_t *flashVectors = &__vector_table;
      
      // Write image specific interrupt vectors into RAM vector table.
      for(counter = 0; counter < 15; ++counter)
      {
        *vectorTable++ = *flashVectors++;
      }
    }
#endif //FEATURE_OAD_BIM
    
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
}
/*
 *  ======== main ========
 */
int main()
{
  PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
    
    /* Initialize ICall module */
    ICall_init();
   
    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();
    
    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
    
    OadTargetApp_createTask();

#ifdef FEATURE_OAD
    {
      uint8_t counter;
      uint32_t *vectorTable =  (uint32_t*) 0x20000000;
      uint32_t *flashVectors = &__vector_table;
      
      // Write image specific interrupt vectors into RAM vector table.
      for(counter = 0; counter < 15; ++counter)
      {
        *vectorTable++ = *flashVectors++;
      }
    }
#endif //FEATURE_OAD
    
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
    
    return 0;
}
示例#8
0
int main()
{
  PIN_init(BoardGpioInitTable);
  //Board_initGeneral();

#ifndef POWER_SAVING
  /* Set constraints for Standby and Idle mode */
  Power_setConstraint(Power_SB_DISALLOW);
  Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING

  /* Initialize ICall module */
  ICall_init();

  /* Start tasks of external images - Priority 5 */
  ICall_createRemoteTasks();

  /* Kick off profile - Priority 3 */
  GAPRole_createTask();

  /* Kick off application - Priority 1 */
  SensorTag_createTask();
  SensorTagTmp_createTask();
  SensorTagHum_createTask();
  SensorTagBar_createTask();

  //UART_init();
  //UART_Params uartParams;
  //UART_Params_init(&uartParams);
  //uartParams.baudRate = 115200;
  //UartPrintf_init(UART_open(Board_UART, &uartParams));

  System_printf("Hello World :)");
  System_flush();
  //printf("Hello World :) 2");

  BIOS_start();     /* enable interrupts and start SYS/BIOS */

  return 0;
}
/*
 *  ======== main ========
 */
Void main()
{
  PIN_init(BoardGpioInitTable);


  //enable iCache prefetching
   VIMSConfigure(VIMS_BASE, TRUE, TRUE);
   
   // Enable cache
   VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
    

    //Initialize task
    Task_Params params;
    Task_Params_init(&params);
    params.priority = TASK_PRI;
    params.stackSize = TASK_STACK_SIZE;
    params.stack = taskStack;

    //semaphore init
    Semaphore_Params sParams;
    Semaphore_Params_init(&sParams);
    sParams.mode = Semaphore_Mode_BINARY;


    /* Initialize ICall module */
    ICall_init();

    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();
    
    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
    
    SimpleBLEPeripheral_createTask();

    //Contruct task
    Task_construct(&taskStruct, taskFxn, &params, NULL);

    // Construct semaphore used for pending in task ADC
    Semaphore_construct(&sem, 0, &sParams);
    hSem = Semaphore_handle(&sem);

#ifdef FEATURE_OAD_BIM
    {
      uint8_t counter;
      uint32_t *vectorTable =  (uint32_t*) 0x20000000;
      uint32_t *flashVectors = &__vector_table;
      
      // Write image specific interrupt vectors into RAM vector table.
      for(counter = 0; counter < 15; ++counter)
      {
        *vectorTable++ = *flashVectors++;
      }
    }
#endif //FEATURE_OAD_BIM
    
    /* enable interrupts and start SYS/BIOS */
    BIOS_start();
}
示例#10
0
/*
 *  ======== main ========
 */
int main()
{
	SB_Error error;

	PIN_init(BoardGpioInitTable);

#ifndef POWER_SAVING
    /* Set constraints for Standby, powerdown and idle mode */
    Power_setConstraint(Power_SB_DISALLOW);
    Power_setConstraint(Power_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
    
    /* Initialize ICall module */
    ICall_init();
#ifdef SB_DEBUG
    System_printf("ICall Initialized.\n");
	System_flush();
#endif

    /* Start tasks of external images - Priority 5 */
    ICall_createRemoteTasks();
#ifdef SB_DEBUG
	System_printf("ICall Remote Tasks Initialized.\n");
	System_flush();
#endif

    /* Kick off profile - Priority 3 */
    GAPRole_createTask();
#ifdef SB_DEBUG
	System_printf("GAP Role Initialized.\n");
	System_flush();
#endif

/* enable I2C */
	if (NoError != (error = SB_i2cInit((I2C_BitRate) I2C_BITRATE))) {
#ifdef SB_DEBUG
		System_printf("Error No: %d\n", error);
		System_printf("SB application initialization failed while initializing I2C. This is a code error.\n");
		System_flush();
#endif

		while(1);
	}

#ifdef SB_DEBUG
	System_printf("I2C Initialized.\n");
	System_flush();
#endif

	/* enable peripheral manager after I2C */
	if (NoError != (error = SB_peripheralInit())) {
#ifdef SB_DEBUG
		System_printf("Error No: %d\n", error);
		System_printf("SB application initialization failed while initializing peripherals. This is a code error.\n");
		System_flush();
#endif

		while(1);
	}

#ifdef SB_DEBUG
	System_printf("Peripherals Initialized.\n");
	System_flush();
#endif

	/* Configure BLE */
	SB_bleInit();
#ifdef SB_DEBUG
	System_printf("SB BLE Initialized.\n");
	System_flush();
#endif

	/* enable interrupts and start SYS/BIOS */
#ifdef SB_DEBUG
    System_printf("Smart Bandage Initialized.\n");
	System_flush();
#endif

    BIOS_start();

    return 0;
}