Example #1
0
void main()
{
	settings = &settings_data;
	
    CyGlobalIntEnable;

	Backlight_Write(1);
	
	disp_reset_Write(0);
	CyDelayUs(10);
	disp_reset_Write(1);
	CyDelayUs(10);
	Display_Start();
	Display_SetContrast(settings->lcd_contrast);
	
	#ifdef USE_SPLASHSCREEN
	load_splashscreen();
	#endif
	

	IDAC_High_Start();
	IDAC_Low_Start();
	set_output_mode(OUTPUT_MODE_FEEDBACK);
		
	start_adc();

	setup();
	
	xTaskCreate(vTaskUI, (signed portCHAR *) "UI", 178, NULL, tskIDLE_PRIORITY + 2, &ui_task);
	xTaskCreate(vTaskComms, (signed portCHAR *) "UART", 141, NULL, tskIDLE_PRIORITY + 2, &comms_task);
	
	prvHardwareSetup();
	vTaskStartScheduler();
}
Example #2
0
void main( void )
{
    prvHardwareSetup();
    /* create two tasks */
    xTaskCreate(vTestKernel, "Task1", 1024, NULL, 1, NULL);
    xTaskCreate(vTestKernel2, "Task2", 512, NULL, 1, NULL);

	/* Start the scheduler running the tasks and co-routines just created. */
	vTaskStartScheduler();

	/* Should not get here unless we did not have enough memory to start the
	scheduler. */
	for( ;; );
}
/*----------------------------------------------------------------------------
   Main: Initialize and start Kernel
*---------------------------------------------------------------------------*/
int main()
{	
    mtx_SerialDebug     = xSemaphoreCreateMutex();  /* Initialize the Debug Mutex           */

    /* Drivers                              */
    UART_Driver_Debug_Init();               /* Initialize serial debug                  */
    GPIO_Driver_Init();                     /* Initialize GPIO                          */
    CySysTickStart();
    /* ISR                                  */
    CyGlobalIntEnable;                      /* Init the interrupts                      */
    
    /* Operating System                     */
    osInit();                               /* Initialize all thread related tasks      */
    prvHardwareSetup();                     /* FreeRTOS setup                           */
	vTaskStartScheduler();                  /* Start the scheduler                      */
    
	return 1;
}
Example #4
0
void main( void )
{
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */
	prvHardwareSetup();

	/* Start the standard demo tasks.  These are just here to exercise the
	kernel port and provide examples of how the FreeRTOS API can be used. */
	vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
	vCreateBlockTimeTasks();
	vStartCountingSemaphoreTasks();
	vStartDynamicPriorityTasks();
	vStartMathTasks( mainINTEGER_TASK_PRIORITY );
	vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );
	vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartQueuePeekTasks();
	vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
	vStartLEDFlashTasks( mainFLASH_TEST_TASK_PRIORITY );
	vAltStartComTestTasks( mainCOM_TEST_TASK_PRIORITY, 57600, mainCOM_LED );
	vStartInterruptQueueTasks();

	/* Start the error checking task. */
  	( void ) xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

	/* Configure the timers used by the fast interrupt timer test. */
	vSetupTimerTest();

	/* The suicide tasks must be created last as they need to know how many
	tasks were running prior to their creation in order to ascertain whether
	or not the correct/expected number of tasks are running at any given time. */
	vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );

	/* Will only get here if there was insufficient memory to create the idle
    task.  The idle task is created within vTaskStartScheduler(). */
	vTaskStartScheduler();

	/* Should never reach here as the kernel will now be running.  If
	vTaskStartScheduler() does return then it is very likely that there was
	insufficient (FreeRTOS) heap space available to create all the tasks,
	including the idle task that is created within vTaskStartScheduler() itself. */
	for( ;; );
}
Example #5
0
void main()
{
    CyGlobalIntEnable;

#if USE_WATCHDOG
    // Enable watchdog timer for every 2 seconds
    CySysWdtWriteMode(0, CY_SYS_WDT_MODE_RESET);
    CySysWdtWriteMatch(0, 0xFFFF);
    CySysWdtEnable(CY_SYS_WDT_COUNTER0_MASK);
#endif

    if(settings->settings_version < default_settings.settings_version)
        factory_reset();
    Backlight_Write(1);	
	disp_reset_Write(0);
	CyDelayUs(10);
	disp_reset_Write(1);
	CyDelayUs(10);
	Display_Start();
    Display_SetContrast(settings->lcd_contrast);
	
	#ifdef USE_SPLASHSCREEN
	load_splashscreen();
	#endif	

	IDAC_High_Start();
	IDAC_Low_Start();
    state.calibrating = 0;
    set_current(0);
	set_output_mode(OUTPUT_MODE_FEEDBACK);		
	start_adc();
	setup();
	//Create the two tasks
	xTaskCreate(vTaskUI, (signed portCHAR *) "UI", 178, NULL, tskIDLE_PRIORITY + 2, &ui_task);
	xTaskCreate(vTaskComms, (signed portCHAR *) "UART", 180, NULL, tskIDLE_PRIORITY + 2, &comms_task);
	
	prvHardwareSetup();
	vTaskStartScheduler();
}