예제 #1
0
int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    memoryInit(spiHandle, 6250);
    // Board_initWatchdog();

    /* Construct heartBeat Task  thread */
    Task_Params_init(&taskParams);
    taskParams.arg0 = 1000000 / Clock_tickPeriod;
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, ledPinTable);
    if(!ledPinHandle) {
        System_abort("Error initializing board LED pins\n");
    }

    //IOCPortConfigureSet(PIN_SPI_MOSI, PORTID, PIN-CONFIG); // oklart om och hur denna funkar.
    //IOCPortConfigureSet(DIOn, PORTID, PIN-CONFIG);
    //PIN_setOutputValue(ledPinHandle, Board_LED1, 1);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #2
0
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUART();

    /* Construct BIOS objects */
    Task_Params taskParams;

    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    taskParams.instance->name = "echo";
    Task_construct(&task0Struct, (Task_FuncPtr)echoFxn, &taskParams, NULL);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);


    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #3
0
/*
 *  ======== main ========
 */
int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initSDSPI();

    /* Construct file copy Task thread */
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)taskFxn, &taskParams, NULL);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the FatSD Raw example\n");

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #4
0
파일: empty.c 프로젝트: erniep/Potatoes
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    // Board_initDMA();
    // Board_initI2C();
    // Board_initSPI();
    // Board_initUART();
    // Board_initUSB(Board_USBDEVICE);
    // Board_initWatchdog();
    // Board_initWiFi();
    Robot_PWM_init();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the example\nSystem provider is set to SysMin. "
                  "Halt the target to view any SysMin contents in ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();


    return (0);
}
예제 #5
0
파일: empty.c 프로젝트: tomaszmat/simulate
/*
 *  ======== main ========
 */
int main(void)
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    // Board_initI2C();
    // Board_initSDSPI();
    // Board_initSPI();
    // Board_initUART();
    // Board_initUSB(Board_USBDEVICE);
    // Board_initWatchdog();
    // Board_initWiFi();

    /* Construct heartBeat Task  thread */
    Task_Params_init(&taskParams);
    taskParams.arg0 = 1000;
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)heartBeatFxn, &taskParams, NULL);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the example\nSystem provider is set to SysMin. "
                  "Halt the target to view any SysMin contents in ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #6
0
int main() {
	// initialize the board
	(void) Board_initGeneral(120 * 1000 * 1000);

	// initialize i2c
	initializeI2C();

	// setup i2c task, who does the work
	(void) setup_I2C_Task();

	// initialize uart
	initializeUART();

	// setup uart task, printing the output
	(void) setup_UART_Task();

	// setup the events which are used in combination with the queues
	(void) setup_Events();

	// initialize interrupts
	initializeInterrupts();

	// setup the interrupts - both for the ALTITUDE CLICK module and the USR_SW
	setup_Interrupts();

	System_printf("Start BIOS\n");
	System_flush();

	/* Start BIOS */
	BIOS_start();

}
/*
 *  ======== main ========
 */
int main(void)
{
    PIN_Handle ledPinHandle;

    /* Call board init functions */
    Board_initGeneral();
    Board_initUART();

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, ledPinTable);
    if(!ledPinHandle) {
        System_abort("Error initializing board LED pins\n");
    }

    PIN_setOutputValue(ledPinHandle, Board_LED1, 1);

    /* This example has logging and many other debug capabilities enabled */
    System_printf("This example does not attempt to minimize code or data "
                  "footprint\n");
    System_flush();

    System_printf("Starting the UART Echo example\nSystem provider is set to "
                  "SysMin. Halt the target to view any SysMin contents in "
                  "ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #8
0
/*
 *  ======== main ========
 */
int main(void) {
	Task_Handle taskHandle;
	Task_Params taskParams;
	Error_Block eb;
#ifdef TIVAWARE
	/*
	 *  This is a work-around for EMAC initialization issues found on
	 *  the TM4C129 devices. The bug number is:
	 *  SDOCM00107378: NDK examples for EK-TM4C1294XL do not work
	 *
	 *  The following disables the flash pre-fetch. It is enable within the
	 *  EMAC driver (in the EMACSnow_NIMUInit() function).
	 */
	UInt32 ui32FlashConf;

	ui32FlashConf = HWREG(0x400FDFC8);
	ui32FlashConf &= ~(0x00020000);
	ui32FlashConf |= 0x00010000;
	HWREG(0x400FDFC8) = ui32FlashConf;
#endif

	/* Call board init functions */
	Board_initGeneral();
	Board_initGPIO();
	Board_initEMAC();

	/*
	 * CyaSSL library needs time() for validating certificates.
	 * USER STEP: Set up the current time in seconds below.
	 */
	MYTIME_init();
	MYTIME_settime(1408053541);

	System_printf("Starting the TCP Echo example\nSystem provider is set to "
			"SysMin. Halt the target to view any SysMin contents in"
			" ROV.\n");
	/* SysMin will only print to the console when you call flush or exit */
	System_flush();

	/*
	 *  Create the Task that farms out incoming TCP connections.
	 *  arg0 will be the port that this task listens to.
	 */
	Task_Params_init(&taskParams);
	Error_init(&eb);

	taskParams.stackSize = 32768;
	taskParams.priority = 1;
	taskParams.arg0 = TCPPORT;
	taskHandle = Task_create((Task_FuncPtr) tcpHandler, &taskParams, &eb);
	if (taskHandle == NULL) {
		System_printf("main: Failed to create tcpHandler Task\n");
	}

	/* Start BIOS */
	BIOS_start();

	return (0);
}
예제 #9
0
int main(void)
{
	/* Call board init functions */
	uint32_t ui32SysClock;
	ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
			SYSCTL_OSC_MAIN |
			SYSCTL_USE_PLL |
			SYSCTL_CFG_VCO_480), 120E6);

	Board_initGeneral(ui32SysClock);
	Board_initEMAC();
	Board_initGPIO();
	// Board_initI2C();
	// Board_initSDSPI();
	// Board_initSPI();
	// Board_initUART();
	// Board_initUSB(Board_USBDEVICE);
	// Board_initUSBMSCHFatFs();
	// Board_initWatchdog();
	// Board_initWiFi();

	setup_ledcube();

	Mailbox_Params mbox_Params;
	Error_Block eb;
	Error_init(&eb);

	_sem = Semaphore_create(0, NULL, &eb);
	if (_sem == NULL) {
		System_abort("Couldn't create semaphore");
	}

	ledEvent = Event_create(NULL,&eb);
	Mailbox_Params_init(&mbox_Params);
	mbox_Params.readerEvent=ledEvent;
	mbox_Params.readerEventId=Event_Id_01;

	mbox_led = Mailbox_create(sizeof(struct ledMatrix),1, &mbox_Params, &eb);
	if(mbox_led == NULL){
		// Do something with errorblock, in the real world
		System_abort("woho!");
	}

	create_led_task((UArg) mbox_led);
	//netOpenHook((UArg) mbox_led);
	netOpenHook(mbox_led);


	System_printf("Starting the example\nSystem provider is set to SysMin. "
			"Halt the target to view any SysMin contents in ROV.\n");

	/* SysMin will only print to the console when you call flush or exit */
	System_flush();

	/* Start BIOS */
	BIOS_start();

	return (0);
}
예제 #10
0
파일: main.c 프로젝트: Iced-Tea/v7
int main(void) {
    Board_initGeneral();

    setvbuf(stdout, NULL, _IOLBF, 0);
    setvbuf(stderr, NULL, _IOLBF, 0);

    return v7_example();
}
예제 #11
0
Int main(Void)
{
    /* Call board init functions */
    Board_initGeneral();

    Log_info0("Hello World!");

    return (0);
}
예제 #12
0
/*
 *  ======== Board_init ========
 *  Initialialize the ti.platforms.tink2 hardware
 */
void Board_init(void)
{
    /* driver-independent initialization */
    Board_initGeneral();

    /* driver-specific initialization */
    Board_initGPIO();
    Board_initPWM();
    Board_initPower();
}
예제 #13
0
int main(void)
{
    /* Call board init functions. */
    Board_initGeneral();
    Board_initGPIO();
    // Board_initI2C();
    // Board_initSDSPI();
    // Board_initSPI();
    // Board_initUART();
    // Board_initWatchdog();

    Clock_Params clockParams;
    Clock_Handle myClock;
    Error_Block eb;
    Task_Handle task0;

    Task_Params taskParams;
    Task_Params_init(&taskParams);

    int j;
    for(j=0; j<17; j++) {
    	buff1[j] = ' ';
    	buff2[j] = ' ';
    }
    Error_init(&eb);
    Clock_Params_init(&clockParams);
    clockParams.period = 100;
    clockParams.startFlag = TRUE;
    myClock = Clock_create(LCD_print, 10, &clockParams, &eb);
    if(myClock == 0)
    {
    	System_abort("F****n clock");
    }

    LCD_init();

    task0 = Task_create(heartBeatFxn, &taskParams, &eb);
   // sample_screen();F
    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);



    System_printf("Starting the example\nSystem provider is set to SysMin. "
                  "Halt the target to view any SysMin contents in ROV.\n");

    //GPIO_write(4,1);
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #14
0
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the SMS Door Bell example\nSystem provider is set"
                  " to SysMin. Halt the target to view any SysMin contents in"
                  " ROV.\n\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Turn off All LEDs. It will be used as a connection indicator */
    GPIO_write(Board_LED0, Board_LED_ON); //Red
    //GPIO_write(Board_LED1, Board_LED_ON); //Orange
    //GPIO_write(Board_LED2, Board_LED_ON); //Green

    /* install Button callback */
    GPIO_setCallback(Board_BUTTON0, gpioButtonFxn0);

    /* Enable interrupts */
    GPIO_enableInt(Board_BUTTON0);

    /*
     *  If more than one input pin is available for your device, interrupts
     *  will be enabled on Board_BUTTON1.
     */
//    if (Board_BUTTON0 != Board_BUTTON1) {
//        /* install Button callback */
//        GPIO_setCallback(Board_BUTTON1, gpioButtonFxn1);
//        GPIO_enableInt(Board_BUTTON1);
//    }

    /*
     * The SimpleLink Host Driver requires a mechanism to allow functions to
     * execute in temporary context.  The SpawnTask is created to handle such
     * situations.  This task will remain blocked until the host driver
     * posts a function.  If the SpawnTask priority is higher than other tasks,
     * it will immediately execute the function and return to a blocked state.
     * Otherwise, it will remain ready until it is scheduled.
     */
    VStartSimpleLinkSpawnTask(SPAWN_TASK_PRI);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initSDSPI();
    Board_initUSBMSCHFatFs();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the FatSD USB Copy example\n");

    /* Start BIOS */
    BIOS_start();

    return (0);
}
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions. */
    Board_initGeneral();
    Board_initGPIO();
    // Board_initI2C();
    // Board_initSDSPI();
    // Board_initSPI();
    // Board_initUART();
    // Board_initWatchdog();

    /* Turn on user LED  */
    GPIO_write(Board_LED0, Board_LED_ON);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #17
0
int main(void) {
  Board_initGeneral();
  Board_initGPIO();
  Board_initWiFi();

  setvbuf(stdout, NULL, _IOLBF, 0);
  setvbuf(stderr, NULL, _IOLBF, 0);
  cs_log_set_level(LL_INFO);
  cs_log_set_file(stdout);

  if (!mg_start_task(MIOT_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
    LOG(LL_ERROR, ("Error starting Mongoose task"));
    return 1;
  }

  osi_start();

  return 0;
}
예제 #18
0
파일: memory.c 프로젝트: tomaszmat/simulate
/*
 *  ======== main ========
 */
Int main()
{
    /* Call board init functions */
    Board_initGeneral();

    /* Construct BIOS objects */
    Task_Params taskParams;
    HeapBuf_Params heapBufParams;
    HeapMem_Params heapMemParams;

    /* Construct writer/reader Task threads */
    Task_Params_init(&taskParams);
    taskParams.stackSize = TASKSTACKSIZE;
    taskParams.stack = &task0Stack;
    Task_construct(&task0Struct, (Task_FuncPtr)task0Fxn, &taskParams, NULL);

    taskParams.stack = &task1Stack;
    Task_construct(&task1Struct, (Task_FuncPtr)task1Fxn, &taskParams, NULL);

    /* Construct two heaps to be used by two separate tasks for alloc and free. */
    HeapBuf_Params_init(&heapBufParams);
    heapBufParams.blockSize = HEAPBUFSIZE / 2;
    heapBufParams.numBlocks = 2;
    heapBufParams.align = 8;
    heapBufParams.buf = heapBufBuffer;
    heapBufParams.bufSize = HEAPBUFSIZE;
    HeapBuf_construct(&heapBufStruct, &heapBufParams, NULL);
    task0Heap = HeapBuf_handle(&heapBufStruct);

    HeapMem_Params_init(&heapMemParams);

    heapMemParams.size = HEAPMEMSIZE;
    heapMemParams.minBlockAlign = 8;
    heapMemParams.buf = heapMemBuffer;
    HeapMem_construct(&heapMemStruct, &heapMemParams);
    task1Heap = HeapMem_handle(&heapMemStruct);

    System_printf("Memory example started.\n");

    BIOS_start();    /* Does not return */
    return(0);
}
예제 #19
0
/*
 *  ======== main ========
 */
Int main(Void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initSDSPI();

    /* Turn on user LED */
    GPIO_write(Board_LED, Board_LED_ON);

    System_printf("Starting the FatSD Raw example\nSystem provider is set to "
                  "SysMin. Halt the target and use ROV to view output.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initEMAC();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the UDP Echo example\nSystem provider is set to "
                  "SysMin. Halt the target to view any SysMin contents in"
                  " ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #21
0
int main(void)
 {
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUART();
    init_clocks();
    init_lcd();
    init_adc();

    /* Turn on user LED */
    //GPIO_write(Board_LED0, Board_LED_ON);
    //GPIO_write(Board_LED1, Board_LED_ON);

    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #22
0
파일: main.c 프로젝트: GisKook/smarthomebox
int main(void)
{
	/* Call board init functions. */
	Board_initGeneral();
	Board_initGPIO();
	Board_initUART();

	UARTConsole_open(false);

	int serialPortFd = rpcOpen(NULL, 0);
	if (serialPortFd == -1)
	{
		dbg_print(PRINT_LEVEL_ERROR, "could not open serial port\n");
		//exit(-1);
		while (1)
			;
	}

	/* Start BIOS */
	BIOS_start();
}
/*
 *  ======== main ========
 */
int main(void)
{
   // Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    // Board_initI2C();
    // Board_initSPI();
    // Board_initUART();
    // Board_initWatchdog();

    /*Timer Init*/
     timer_init();

    /*LED Init*/
    led_init();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #24
0
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initEMAC();

    /* CyaSSL library needs time() for validating certificates. */
    //MYTIME_init();
    //MYTIME_settime(CURRENTTIME);

    System_printf("Starting the SSH/TCP Echo example\nSystem provider is set "
                  "to SysMin. Halt the target to view any SysMin contents in"
                  " ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #25
0
파일: App.c 프로젝트: supermk2/Tiva_C
/*
 *  ======== main ========
 */
int main(void)
{
    Clock_Handle clkHandle;
    Clock_Params clkParams;
    
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUART();

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_OFF);
    GPIO_write(Board_LED1, Board_LED_ON);   
    
    GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_PIN_0);

    System_printf("Hello World\n");
    
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    /* Create a periodic Clock Instance with period = 5 system time units */
    Clock_Params_init(&clkParams);
    clkParams.period = 1000;
    clkParams.startFlag = TRUE;
    Clock_create(clk0Fxn, 5, &clkParams, NULL);

    /* Create an one-shot Clock Instance with timeout = 11 system time units */
    clkParams.period = 0;
    clkParams.startFlag = FALSE;
    clkHandle = Clock_create(clk1Fxn, 11, &clkParams, NULL);
    Clock_start(clkHandle);

    /* Start BIOS */
    BIOS_start();

    return (0);
}
/*
 *  ======== main ========
 */
int main(void)
{
    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUSB(Board_USBHOST);

    /* Turn on user LED */
    GPIO_write(Board_LED0, Board_LED_ON);

    System_printf("Starting the USB Keyboard Host example\nSystem provider is "
                  "set to SysMin. Halt the target to view any SysMin contents"
                  " in ROV.\n");
    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    USBKBH_init();

    /* Start BIOS */
    BIOS_start();

    return (0);
}
예제 #27
0
//*****************************************************************************
//
//! Main application function.
//!
//! This function is meant to initialize all devices and tasks used in this
//! application. After the initialization is complete, the tasks start running.
//!
//! \return None.
//
//*****************************************************************************
int main(void)
{
    // Initialize General configurations
    Board_initGeneral();

    // Initialize GPIO
    Board_initGPIO();

    // Turn off all LEDS
    GPIO_write(Board_LED0, Board_LED_OFF);
    GPIO_write(Board_LED1, Board_LED_OFF);
    GPIO_write(Board_LED2, Board_LED_OFF);

	// Initializes interrupts
    GPIO_setCallback(Board_BUTTON0, _callback_Button_Select);
    GPIO_setCallback(Board_BUTTON1, _callback_Button_Up);
    GPIO_setCallback(Board_BUTTON2, _callback_Button_Down);
    GPIO_setCallback(Board_SENSE_RISER_DOWN, _callback_Festo_Riser_Down);
    GPIO_setCallback(Board_SENSE_RISER_UP, _callback_Festo_Riser_Up);
    GPIO_setCallback(Board_SENSE_SAMPLE_IN_PLACE, _callback_Festo_Piece_In);

    // Enable Interrupts
    GPIO_enableInt(Board_BUTTON0);
    GPIO_enableInt(Board_BUTTON1);
    GPIO_enableInt(Board_BUTTON2);
    GPIO_enableInt(Board_SENSE_RISER_DOWN);
    GPIO_enableInt(Board_SENSE_RISER_UP);
    GPIO_enableInt(Board_SENSE_SAMPLE_IN_PLACE);

    Seconds_set(1432639800);

    // Start BIOS
    BIOS_start();

    return (0);
}
예제 #28
0
/*
 *  ======== main ========
 */
Int main(Void) {
	/*Task_Handle taskHandle;
	 Task_Params taskParams;
	 Error_Block eb;*/
	short merge = 0;
	char *temp = (char *) &merge;

	Get_EvnString();					/// got enviroment form flash 0x80000

	/* Call board init functions */
	Board_initGeneral();
	Board_initGPIO();
	Board_initEMAC();
	Board_initUART();




	INIT_UART1_Printf();

	System_printf("Starting the Array Mang\nSystem provider is set to "
			"SysMin. Halt the target and use ROV to view output.\n");
	/* SysMin will only print to the console when you call flush or exit */
	System_flush();

	Log_info0("Create TCP task");

	// Create TCP task
	Task_Handle TCP_taskHandle;
	Task_Params TCP_taskParams;
	Error_Block TCP_eb;
	Task_Params_init(&TCP_taskParams);
	Error_init(&TCP_eb);
	TCP_taskParams.stackSize = 10240;					//8192;
	TCP_taskParams.priority = 2;
	TCP_taskHandle = Task_create((Task_FuncPtr) tcpHandler, &TCP_taskParams,
			&TCP_eb);
	if (TCP_taskHandle == NULL) {
		UARTprintf("main: Failed to create tcpHandler Task\n");
	}

	TCP_Periodic_Link_time.Updata_Period[1] = G_ENVCONFIG.Pollingtime[0];
	TCP_Periodic_Link_time.Updata_Period[0] = G_ENVCONFIG.Pollingtime[1];
	*temp = TCP_Periodic_Link_time.Updata_Period[0];
	*(temp + 1) = TCP_Periodic_Link_time.Updata_Period[1];

	test_merge = merge;
	//UARTprintf((const char*)"\n\n\n\n----Array Pollingtime = %d----\n\n\n\n\n",merge);

	TCP_Periodic_Link_time.TCP_Link_Period[0] = 0x3c;	// TCP LINK Period
	TCP_Periodic_Link_time.TCP_Link_Period[1] = 0x00;

	//Timer-periodic
	Clock_Params clockParams;
	Error_Block eb_timer;
	Error_init(&eb_timer);
	Clock_Params_init(&clockParams);
	clockParams.period = merge * Time_Tick;
	clockParams.startFlag = TRUE;
	Periodic_Handle = Clock_create(TimeTick_Periodic, First_Periodic_time,
			&clockParams, &eb_timer);
	if (Periodic_Handle == NULL) {
		System_abort("Clock create failed");
	}

	//Timer-Time_Stamp
	Clock_Params_init(&clockParams);
	clockParams.period = TimeStamp_time;
	clockParams.startFlag = TRUE;
	AM_Timer_Handle = Clock_create(TimeTick_TimeStamp, 1, &clockParams,
			&eb_timer);
	if (AM_Timer_Handle == NULL) {
		System_abort("Clock create failed");
	}

	/* Start BIOS */
	BIOS_start();

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

    Mailbox_Params mboxParams;
    /*    Task_Params grlibTaskParams;
        Task_Params consoleTaskParams;
        Task_Handle grlibTaskHandle;
        Task_Handle consoleTaskHandle;*/

    Error_Block eb;

    /* Init board-specific functions. */
    Board_initGeneral();
    Board_initGPIO();
    Board_initUART();
    Board_initUSB(Board_USBDEVICE);
    /* Turn on user LED */
//    GPIO_write(DK_TM4C123G_LED, DK_TM4C123G_LED_ON);

    add_device("UART", _MSA, UARTUtils_deviceopen,
               UARTUtils_deviceclose, UARTUtils_deviceread,
               UARTUtils_devicewrite, UARTUtils_devicelseek,
               UARTUtils_deviceunlink, UARTUtils_devicerename);

    /* Open UART0 for writing to stdout and set buffer */
    freopen("UART:0", "w", stdout);
    setvbuf(stdout, NULL, _IOLBF, 128);

    /* Open UART0 for reading from stdin and set buffer */
    freopen("UART:0", "r", stdin);
    setvbuf(stdin, NULL, _IOLBF, 128);

    /*
     *  Initialize UART port 0 used by SysCallback.  This and other SysCallback
     *  UART functions are implemented in UARTUtils.c. Calls to System_printf
     *  will go to UART0, the same as printf.
     */
    UARTUtils_systemInit(0);

    /* Init LCD and USBCDC */
    LCD_init();
//    USBCDCD_init();

    TouchScreenInit();

    TouchScreenCallbackSet(grlibTouchTaskFxn);


    Bounder_set();

    LED_OFF();
    /* Init and enable interrupts */
    GPIO_setupCallbacks(&EK_TM4C123GXL_gpioPortFCallbacks);

    GPIO_enableInt(EK_TM4C123GXL_SW1, GPIO_INT_RISING);
    GPIO_enableInt(EK_TM4C123GXL_SW2, GPIO_INT_RISING);

    /* SYS/BIOS Mailbox create */
    Error_init(&eb);
    Mailbox_Params_init(&mboxParams);
    mailboxHandle = Mailbox_create(sizeof(DrawMessage), 2, &mboxParams, &eb);
    if (mailboxHandle == NULL) {
        System_abort("Mailbox create failed\nAborting...");
    }

    /* Console task create */
    /* Error_init(&eb);
     Task_Params_init(&consoleTaskParams);
     consoleTaskParams.instance->name = "consoleTask";
     consoleTaskParams.stackSize = 1024;
     consoleTaskParams.priority = 2;
     consoleTaskHandle = Task_create(consoleTaskFxn, &consoleTaskParams, &eb);
     if (consoleTaskHandle == NULL) {
         System_abort("Console task was not created\nAborting...");
     }

      Grlib task create
     Error_init(&eb);
     Task_Params_init(&grlibTaskParams);
     grlibTaskParams.instance->name = "grlibTask";
     grlibTaskParams.stackSize = 2048;
     grlibTaskParams.priority = 1;
     grlibTaskHandle = Task_create(grlibTaskFxn, &grlibTaskParams, &eb);
     if (grlibTaskHandle == NULL) {
         System_abort("Grlib task was not created\nAborting...");
     }*/

    System_printf("Starting the example\n%s, %s",
                  "System provider is set to SysMin",
                  "halt the target and use ROV to view output.\n");

    /* SysMin will only print to the console when you call flush or exit */
    System_flush();

    USBCDCD_init();//?????? why not working
    fillBox(4);
    fillBox(4);
    output(4,Array2048);
    /* Start BIOS. Will not return from this call. */
    BIOS_start();

    return (0);
}
예제 #30
0
파일: App.c 프로젝트: supermk2/Tiva_C
Int main()
{
    Task_Params taskParams;

    /* Call board init functions */
    Board_initGeneral();
    Board_initGPIO();
    Board_initPWM();
    Board_initUART();
    Board_initI2C();
    
    GPIO_write(Board_LED0, Board_LED_ON);
    GPIO_write(Board_LED1, Board_LED_OFF);   

    Task_Params_init(&taskParams);
    taskParams.priority = 2;
    objTask[0] = Task_create (Task_IDLE, &taskParams, NULL);

    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    objTask[1] = Task_create (Task_GPIO, &taskParams, NULL);

    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    objTask[2] = Task_create (Task_PWM, &taskParams, NULL);

 #if 0
    //for use Lowlevel SIO API
    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    objTask[3] = Task_create (Task_UART, &taskParams, NULL);
 #else
    //for use Highlevel SIO API(printf, scanf)
    add_device("UART", _MSA, UARTUtils_deviceopen,
               UARTUtils_deviceclose, UARTUtils_deviceread,
               UARTUtils_devicewrite, UARTUtils_devicelseek,
               UARTUtils_deviceunlink, UARTUtils_devicerename);

    /* Open UART0 for writing to stdout and set buffer */
    freopen("UART:0", "w", stdout);
    setvbuf(stdout, NULL, _IOLBF, 128);

    /* Open UART0 for reading from stdin and set buffer */
    freopen("UART:0", "r", stdin);
    setvbuf(stdin, NULL, _IOLBF, 128);

    /*
     *  Initialize UART port 0 used by SysCallback.  This and other SysCallback
     *  UART functions are implemented in UARTUtils.c. Calls to System_printf
     *  will go to UART0, the same as printf.
     */
    UARTUtils_systemInit(0);
 #endif

    Task_Params_init(&taskParams);
    taskParams.priority = 1;
    objTask[4] = Task_create (Task_I2C, &taskParams, NULL);

    BIOS_start();    /* does not return */
    return(0);
}