/* * ======== 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); }
/* * ======== 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); }
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); }
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) { 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_initUART(); 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(); while (1) { } }
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); }
/* * ======== 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); }
/* * ======== 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); }