Beispiel #1
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 #2
0
static void configure_console(void) {

	sysclk_enable_peripheral_clock(PRINTF_USART_ID);

	//const usart_serial_options_t uart_serial_options = { .baudrate = CONF_UART_BAUDRATE, .paritytype = CONF_UART_PARITY, };

	const usart_serial_options_t uart_serial_options = {
	      .baudrate = USART_BAUDRATE,
	      .charlength =   USART_CHAR_LENGTH,
	      .paritytype = USART_PARITY,
	      .stopbits = false
	      //US_MR_CHMODE_NORMAL
	   };

	usart_serial_init(PRINTF_USART, &uart_serial_options);
	stdio_serial_init(PRINTF_USART, &uart_serial_options);

	usart_enable_tx(PRINTF_USART);
	usart_enable_rx(PRINTF_USART);
}

int main(void) {
	sysclk_init();
	board_init();

	configure_console();
	printf("CPH BaseStation v%d\r\n", 1);

	printf("create_uart_cli_task\r\n");
	create_uart_cli_task(CONSOLE_UART, mainUART_CLI_TASK_STACK_SIZE, mainUART_CLI_TASK_PRIORITY);
//	printf("create_dialer_task\r\n");
//	create_dialer_task(mainDIALER_TASK_STACK_SIZE, mainDIALER_TASK_PRIORITY);

	printf("create_comm_task\r\n");
	create_comm_task(mainCOMM_TASK_STACK_SIZE, mainCOMM_TASK_PRIORITY);

	printf("create_apptask_task\r\n");
	create_app_task(mainAPPTASK_TASK_STACK_SIZE, mainAPPTASK_TASK_PRIORITY);

	printf("create_led_task\r\n");
	create_led_task();


	printf("starting task scheduler\r\n");
	/* Start the scheduler. */
	vTaskStartScheduler();

	for (;;) {
	}

	/* Will only get here if there was insufficient memory to create the idle task. */
	return 0;
}