/*
 *  ======== 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);
}
/*
 *  ======== exchange ========
 * Called when LoggerStream is full
 */
Ptr exchange(LoggerStreamer2_Object *log, Ptr full)
{
    UInt32 id = (UInt32)LoggerStreamer2_getContext(log);
    Int i, len;
    UInt32 *wordPtr = (UInt32 *)full;

    if (id >= NUMBUFS) {
        return (NULL);
    }

    /* Print the UIA packet */
    if (ENDIANNESS) {
        System_printf("UIA Packet Header: 0x%.8lx 0x%.8lx 0x%.8lx 0x%.8lx\r\n",
                (ULong)wordPtr[0], (ULong)wordPtr[1],
                (ULong)wordPtr[2], (ULong)wordPtr[3]);
    }
    else {
        System_printf("UIA Packet Header: 0x%.8lx 0x%.8lx 0x%.8lx 0x%.8lx\r\n",
                (ULong)UIAPacket_swizzle(wordPtr[0]),
                (ULong)UIAPacket_swizzle(wordPtr[1]),
                (ULong)UIAPacket_swizzle(wordPtr[2]),
                (ULong)UIAPacket_swizzle(wordPtr[3]));
    }

    /* Print the UIA packet body */
    len = UIAPacket_getLength((UIAPacket_Hdr *)wordPtr);
    wordPtr += 4;
    for (i = 4; i < (len / 4); i++) {
        System_printf("\t0x%.8lx\n", *wordPtr++);
    }
    System_flush();

    /* If there is still space in the buffer print the invalid packet */
    if (len < BUFSIZE) {
        if (ENDIANNESS) {
            System_printf("UIA Invalid Packet Header: 0x%.8lx\n", *wordPtr);
        }
        else {
            System_printf("UIA Invalid Packet Header: 0x%.8lx\n",
                    UIAPacket_swizzle(*wordPtr));
        }
        len = UIAPacket_getLength((UIAPacket_Hdr *)wordPtr++);
        for (i = 1; i < (len / 4); i++) {
            System_printf("\t0x%.8lx\n", *wordPtr++);
        }
    }

    System_flush();

    /*
     *  Clear all but the UIAPacket header.  This is not necessary, but
     *  may be useful for debugging.
     */
    initBuffer((Char *)full + sizeof(UIAPacket_Hdr),
            BUFSIZE - sizeof(UIAPacket_Hdr));

    return (full);
}
Beispiel #3
0
void test_is_Directions_Ok(){
	bool lSuccess = true;
	System_printf("*******Direction testing********\r\n");
	lSuccess &= test_is_Wheel_Direction_Left(0);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Left(1);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Left(2);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Left(3);
	System_flush();

	lSuccess &= test_is_Wheel_Direction_Right(0);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Right(1);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Right(2);
	System_flush();
	lSuccess &= test_is_Wheel_Direction_Right(3);
	System_flush();

	if(lSuccess){
		System_printf("[SUCCESS]\r\n");
	}
	else{
		System_printf("[FAILURE]\r\n");
	}
	System_flush();
}
Beispiel #4
0
void test_is_SpiDevices_Working_Well(){
	//System_printf("%d\r\n",arduino_Test(),ARDUINO_RECALL_MESSAGE);
	bool tested = true;
	System_printf("*******SPI Device testing********\r\n");
	if(arduino_Test())
		System_printf("Arduino [OK]\r\n");
	else{
		System_printf("Arduino [FAIL]\r\n");
		tested =  false;
	}
	System_flush();

	if(gyro_test())
		System_printf("Gyro [OK]\r\n");
	else{
		System_printf("Gyro [FAIL]\r\n");
		tested = false;
	}

	if(quad_test(&HandleRobot.HandleQuad[0]))
		System_printf("Quad 0 [OK]\r\n");
	else{
		System_printf("Quad 0 [FAIL]\r\n");
		tested = false;
	}

	System_flush();

	if(quad_test(&HandleRobot.HandleQuad[1]))
			System_printf("Quad 1 [OK]\r\n");
	else{
		System_printf("Quad 1 [FAIL]\r\n");
		tested = false;
	}

	if(nRF_test())
		System_printf("RF [OK]\r\n");
	else{
		System_printf("RF [FAIL]\r\n");
		tested = false;
	}

	System_flush();

	if(tested)
		System_printf("SUCCESS\r\n");
	else
		System_printf("FAILURE\r\n");

	System_flush();
}
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();

}
Beispiel #6
0
/*
 *  ======== printDrive ========
 *  Function to print drive information such as the total disk space
 *  This function was created by referencing FatFs's API documentation
 *  http://elm-chan.org/fsw/ff/en/getfree.html
 *
 *  This function call may take a while to process, depending on the size of
 *  SD Card used.
 */
void printDrive(const char *driveNumber, FATFS **fatfs)
{
    FRESULT        fresult;
    DWORD          freeClusterCount;
    DWORD          totalSectorCount;
    DWORD          freeSectorCount;

    System_printf("Reading disk information...");
    System_flush();

    fresult = f_getfree(driveNumber, &freeClusterCount, fatfs);
    if (fresult) {
        System_abort("Error getting the free cluster count from the FatFs object");
    }
    else {
        System_printf("done\n");

        /* Get total sectors and free sectors */
        totalSectorCount = ((*fatfs)->n_fatent - 2) * (*fatfs)->csize;
        freeSectorCount  = freeClusterCount * (*fatfs)->csize;

        /* Print the free space (assuming 512 bytes/sector) */
        System_printf("Total Disk size: %10lu KiB\n"
                      "Free Disk space: %10lu KiB\n",
                      totalSectorCount / 2,
                      freeSectorCount  / 2);
    }
}
Beispiel #7
0
/*
 *  ======== 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);
}
Beispiel #8
0
/*
 *  ======== main ========
 */
int main()
{
    /* initialize all device/board specific peripherals */
    Board_init();

    Task_Params taskParams;

    System_printf("Startup\n");
    System_flush();

    /* initialize taskParams to the defaults */
    Task_Params_init(&taskParams);

    taskParams.priority = Task_numPriorities - 1;
    taskParams.stackSize = 0x800;

    /* Set the task name */
    taskParams.instance->name = (xdc_String)"hello";

    /* Create the task */
    Task_create(hello_task, &taskParams, NULL);

    /* does not return */
    BIOS_start();

    return (0); /* should never get here, but just in case ... */
}
Beispiel #9
0
/*
 *  ======== 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);
}
Beispiel #10
0
void netOpenHook(UArg uarg0)
{
	Task_Handle taskHandle;
	Task_Params taskParams;
	Error_Block eb;

	/* Make sure Error_Block is initialized */
	Error_init(&eb);

	/*
	 *  Create the Task that farms out incoming TCP connections.
	 *  arg0 will be the port that this task listens to.
	 */
	Task_Params_init(&taskParams);
	taskParams.stackSize = UDPHANDLERSTACK;
	taskParams.priority = 1;
	taskParams.arg0 = UDPPORT;
	//mbox
	taskParams.arg1 = uarg0;
	taskHandle = Task_create((Task_FuncPtr)udpHandler, &taskParams, &eb);
	if (taskHandle == NULL) {
		System_printf("netOpenHook: Failed to create tcpHandler Task\n");
	}

	System_flush();
}
Beispiel #11
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);
}
Beispiel #12
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);
}
Beispiel #13
0
/*
 *  ======== testwolfcrypt ========
 *  Run the wolfcrypt test
 */
void testwolfcrypt(UArg arg0, UArg arg1)
{
    System_printf("Running wolfcrypt tests...\n");
    System_flush();
    wolfcrypt_test((void *)arg0);
    System_printf("Tests completed.\n");

    BIOS_exit(0);
}
Beispiel #14
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);
}
/*
 *  ======== runBenchmarks ========
 *  Run the CyaSSL benchmark application
 */
void runBenchmarks(UArg arg0, UArg arg1)
{
    void *args = NULL;
    msTimer_init();

    System_printf("Running benchmarks...\n");
    System_flush();
    benchmark_test(args);
    System_printf("Benchmarks completed.\n");

    BIOS_exit(0);
}
Beispiel #16
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);
}
Beispiel #17
0
/*
 *  ======== tcpWorker ========
 *  Task to handle TCP connection. Can be multiple Tasks running
 *  this function.
 */
Void tcpWorker(UArg arg0, UArg arg1)
{
    int rc;
    int clientfd = 0;
    SSH *ssh = (SSH *)arg0;

    clientfd = SSH_get_fd(ssh);
    System_printf("tcpWorker: start clientfd = 0x%x\n", clientfd);

    /* Init structs */
    transportInit(ssh);

    /* Signal active session */
    ssh->ctx->actSe = 1;

    /* Version exchange */
    rc = transportVersion_hd(ssh);
    if (rc < 0 )
        goto ABORT;
    if (rc == 1)
        goto PROCESS;

    /* Main loop */
    for (;;) {
        /* Read plain/encrypt packet from client */
        rc = transportGetPacket(ssh);
        if (rc < 0)
            break;

PROCESS:
        rc = transportExtract(ssh);
        if (rc < 0)
            break;

        /* Process the reply packet */
        rc = transportProcessPacket(ssh);
        if (rc != 0)
            break;

        //System_flush();
    }

ABORT:
    System_printf("tcpWorker stop clientfd = 0x%x\n", clientfd);
    System_flush();

    if (ssh)
        SSH_free(ssh);
    close(clientfd);
}
/*
 *  ======== IPv6DADStatus ========
 *  IPv6 initialization callback function
 */
static void IPv6DADStatus(IP6N Address, unsigned short dev_index,
        unsigned char Status)
{
    char strIPAddress[40];

    /* Convert the IP Address to String Format. */
    inet_ntop(AF_INET6, &Address, strIPAddress, 40);

    /* Print the status of the address. */
    System_printf("Address: %s on device %d is %s\n", strIPAddress, dev_index,
            (Status == 1) ? "UNIQUE" : "DUPLICATE");

    System_flush();

    return;
}
Beispiel #19
0
void test_is_All_Encoder_Are_Matched_With_Wheels(){
	bool lSuccess = true;
	System_printf("*******Encoder testing********\r\n");
	lSuccess &= test_is_Encoder_is_Matched_With_Wheel(0);;
	lSuccess &= test_is_Encoder_is_Matched_With_Wheel(1);
	lSuccess &= test_is_Encoder_is_Matched_With_Wheel(2);
	lSuccess &= test_is_Encoder_is_Matched_With_Wheel(3);

	if(lSuccess){
			System_printf("[SUCCESS]\r\n");
	}
	else{
		System_printf("[FAILURE]\r\n");
	}
	System_flush();

}
Beispiel #20
0
void cmdExecute (char* cmdInput, uint8_t data) {
	int i;
	char inA, inB;
	for (i = 0; i<sizeof(cmdList)/sizeof(char*); i++) {
		inA = *cmdList[i];
		inB = *cmdInput;

		if (inA == inB) {
			System_printf("cmdExecute\n");
			System_flush();
			(*cmdFunctions[i])(dutyMain);
			if ((inA != '+') && (inA != '-')) {
				lastCommand = cmdFunctions[i];
			}
			return;
		}
	}
}
Beispiel #21
0
/*
 *  ======== main ========
 */
Void main()
{
	Int status;
	struct HeapBufMP_Params heapBufMPParams;
	HeapBufMP_Handle heapHandle;

    System_printf("Enter main()\n");
    System_flush();

    /* Call Ipc_start() */
    status = Ipc_start();
    if (status < 0) {
    	System_abort("Ipc_start failed\n");
    	}

#ifdef DSP_ACTIVE
    /* Attach to DSP */
	while (Ipc_attach(1) < 0) {
		Task_sleep(1000);
	};
#endif

#if 1
	/* Create the heap that will be used to allocate messages. */
	HeapBufMP_Params_init(&heapBufMPParams);
	heapBufMPParams.regionId = 0; /* use default region */
	heapBufMPParams.name = "shareHeap";
	heapBufMPParams.align = 4;
	heapBufMPParams.numBlocks = 40;
	heapBufMPParams.blockSize = 256;
	heapBufMPParams.gate = NULL; /* use system gate */
	heapHandle = HeapBufMP_create(&heapBufMPParams);
	if (heapHandle == NULL) {
		System_abort("HeapBufMP_create failed\n");
		while(1);
	}
	/* Register this heap with MessageQ */
	if(MessageQ_registerHeap(heapHandle, 0) != MessageQ_S_SUCCESS) while(1);

#endif

    BIOS_start();     /* enable interrupts and start SYS/BIOS */
}
/*
 *  ======== callback ========
 *  Watchdog interrupt callback function. It toggles and LED, and if a button
 *  has not been pressed, clears the watchdog interrupt flag.
 */
void vINMD_watchdog_callback(UArg handle)
{
  ERROR_CODE eEC;

  eEC = eBSP_debugger_detect();
  if(eEC == ER_OK)
  {
    System_printf("****!!!!SYS HALT!!!!****\r\n");
    System_printf("Watchdog Bark!\r\n");
    System_flush();
    vDEBUG_ASSERT("Watchdog Bark!",0);
  }
  else
  {
    vDEBUG("Watchdog Bark!");
    vDEBUG("****!!!!SYS RESET!!!!****\r\n");
    ROM_IntMasterDisable();
    ROM_SysCtlReset();
  }
}
Beispiel #23
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);
}
Beispiel #24
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);
}
/*
 *  ======== 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);
}
Beispiel #26
0
void maintenanceTask() {

	System_printf("Main Task started\n");
	System_flush();

#if 1
	/* Enable radio SPI */
	spicom_init();
#endif

#if 1
	/* Enable Trace */
	trace_init();
#endif

#if 1
	/* Digital io */
	dio_init();
#endif


#ifdef RN_ACTIVE
	rn_sysbios_init();
	rn_module_init();
	ap_sim_module_init();

	//rn_sysbios_start();

	rn_module_start(1);
	ap_sim_module_start(1);

	rn_module_start(2);
	ap_sim_module_start(2);

#endif

	maintenanceMainTask();
	/* Should never return but in case*/
	Task_exit();
}
Beispiel #27
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;
}
Beispiel #28
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);
}
Beispiel #29
0
/*
 *  ======== 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);
}
Beispiel #30
0
void BtStack_framePrint(const BtStack_Frame* frame, KfpPrintFormat format)
{
	System_printf("ID =");
	uint8_t i;
	for (i=0; i<4; i++)
	{
		System_printf(" %u", frame->id.b8[i]);
	}

	System_printf(" Data =");
	for (i=0; i<8; i++)
	{
		if (format == KFPPRINTFORMAT_ASCII)
		{
			System_printf("%c", frame->payload.b8[i]);
		}
		else if (format == KFPPRINTFORMAT_HEX)
		{
			System_printf("%x", frame->payload.b8[i]);
		}
	}
	System_flush();
}