int main( void ) { /* ************************************************************************* This is a very simple project suitable for getting started with FreeRTOS. If you would prefer a more complex project that demonstrates a lot more features and tests, then select the 'Full' build configuration within the SDK Eclipse IDE. ***************************************************************************/ /* Configure the interrupt controller, LED outputs and button inputs. */ prvSetupHardware(); /* Create the queue used by the queue send and queue receive tasks as described in the comments at the top of this file. */ xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) ); /* Sanity check that the queue was created. */ configASSERT( xQueue ); /* Start the two tasks as described in the comments at the top of this file. */ xTaskCreate( prvQueueReceiveTask, ( signed char * ) "Rx", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_RECEIVE_TASK_PRIORITY, NULL ); xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, NULL, mainQUEUE_SEND_TASK_PRIORITY, NULL ); /* Create the software timer that is responsible for turning off the LED if the button is not pushed within 5000ms, as described at the top of this file. The timer is not actually started until a button interrupt is pushed, as it is not until that point that the LED is turned on. */ xLEDTimer = xTimerCreate( ( const signed char * ) "LEDTimer", /* A text name, purely to help debugging. */ ( 5000 / portTICK_RATE_MS ), /* The timer period, in this case 5000ms (5s). */ pdFALSE, /* This is a one shot timer, so xAutoReload is set to pdFALSE. */ ( void * ) 0, /* The ID is not used, so can be set to anything. */ vLEDTimerCallback /* The callback function that switches the LED off. */ ); /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created. See the memory management section on the FreeRTOS web site for more details. */ for( ;; ); }
int main( void ) { prvSetupHardware(); /* Create the queue used to pass "I'm alive" messages to the check task. */ xFileScopeCheckQueue = xQueueCreate( 1, sizeof( unsigned long ) ); /* One check task uses the task parameter to receive the queue handle. This allows the file scope variable to be accessed from within the task. The pvParameters member of xRegTest2Parameters can only be set after the queue has been created so is set here. */ xRegTest2Parameters.pvParameters = xFileScopeCheckQueue; /* Create the three test tasks. Handles to the created tasks are not required, hence the second parameter is NULL. */ xTaskCreateRestricted( &xRegTest1Parameters, NULL ); xTaskCreateRestricted( &xRegTest2Parameters, NULL ); xTaskCreateRestricted( &xCheckTaskParameters, NULL ); /* Create the tasks that are created using the original xTaskCreate() API function. */ xTaskCreate( prvOldStyleUserModeTask, /* The function that implements the task. */ ( signed char * ) "Task1", /* Text name for the task. */ 100, /* Stack depth in words. */ NULL, /* Task parameters. */ 3, /* Priority and mode (user in this case). */ NULL /* Handle. */ ); xTaskCreate( prvOldStylePrivilegedModeTask, /* The function that implements the task. */ ( signed char * ) "Task2", /* Text name for the task. */ 100, /* Stack depth in words. */ NULL, /* Task parameters. */ ( 3 | portPRIVILEGE_BIT ), /* Priority and mode. */ NULL /* Handle. */ ); /* Start the scheduler. */ vTaskStartScheduler(); /* Will only get here if there was insufficient memory to create the idle task. */ for( ;; ); return 0; }
/* * Creates the majority of the demo application tasks before starting the * scheduler. */ void main(void) { xTaskHandle xCreatedTask; prvSetupHardware(); /* Start the reg test tasks which test the context switching mechanism. */ xTaskCreate( vRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCreatedTask ); xPortUsesFloatingPoint( xCreatedTask ); xTaskCreate( vRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCreatedTask ); xPortUsesFloatingPoint( xCreatedTask ); xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL ); /* Start the check task as described at the top of this file. */ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); /* Start the standard demo tasks. These don't perform any particular useful functionality, other than to demonstrate the FreeRTOS API being used. */ vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vCreateBlockTimeTasks(); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY ); vStartQueuePeekTasks(); vStartRecursiveMutexTasks(); /* Start the math tasks as described at the top of this file. */ vStartMathTasks( mainFLOP_TASK_PRIORITY ); /* 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 ); /* Start the tasks running. */ vTaskStartScheduler(); /* Will only get here if there was insufficient heap memory to create the idle task. Increase the configTOTAL_HEAP_SIZE setting in FreeRTOSConfig.h. */ for( ;; ); }
int main (void) { char i; prvSetupHardware (); for(i=0; i<sizeof(ob_data); i++) { send_buffer.payload[i]=0; recv_buffer.payload[i]=0; } xTaskCreate (vUSBCDCTask , (signed portCHAR *) "USB_CDC" , mainUSB_TASK_STACK , NULL, mainUSB_PRIORITY, NULL); vTaskStartScheduler (); ob_app_start=xTaskGetTickCount(); ob_send_time=xTaskGetTickCount(); return 0; }
int main(void) { prvSetupHardware(); queueCreation(); taskCreation(); __enable_irq(); chSysInit(); while (TRUE){ } return 0; }
/*-----------------------------------------------------------*/ int main( void ) { /* Prepare the hardware to run this demo. */ prvSetupHardware(); /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ xTaskCreate( prvDataSendTask, /* The function that implements the task. */ ( signed char * ) "DataSend", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ DATA_SEND_TASK_STACK_SIZE, /* The size of the stack to allocate to the task. */ ( void * ) DATA_SEND_TASK_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ DATA_SEND_TASK_PRIORITY, /* The priority assigned to the task. */ NULL ); /* The task handle is not required, so NULL is passed. */ xTaskCreate( prvDataReceiveTask, /* The function that implements the task. */ ( signed char * ) "Sensor", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ DATA_RECEIVE_TASK_STACK_SIZE, /* The size of the stack to allocate to the task. */ ( void * ) DATA_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ DATA_RECEIVE_TASK_PRIORITY, /* The priority assigned to the task. */ NULL ); /* The task handle is not required, so NULL is passed. */ xTaskCreate( prvControlTask, /* The function that implements the task. */ ( signed char * ) "Sensor", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ CONTROL_TASK_STACK_SIZE, /* The size of the stack to allocate to the task. */ ( void * ) CONTROL_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ CONTROL_TASK_PRIORITY, /* The priority assigned to the task. */ NULL ); /* The task handle is not required, so NULL is passed. */ // xTaskCreate( prvBlinkLedTask, /* The function that implements the task. */ // ( signed char * ) "Led", /* The text name assigned to the task - for debug only as it is not used by the kernel. */ // configMINIMAL_STACK_SIZE, /* The size of the stack to allocate to the task. */ // ( void * ) LED_BLINK_PARAMETER, /* The parameter passed to the task - just to check the functionality. */ // BLINKY_TASK_PRIORITY, /* The priority assigned to the task. */ // NULL ); /* The task handle is not required, so NULL is passed. */ /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created. See the memory management section on the FreeRTOS web site for more details. */ for( ;; ); return 0; }
int main(void) { /* Setup the hardware. */ prvSetupHardware(); /* Create the SPI mutex */ xSPIMutex = xSemaphoreCreateMutex(); /* Initialize the MAC layer */ mac_init(xSPIMutex, packet_received, CHANNEL); /* Add the local task */ xTaskCreate( vSendingTask, (const signed char*) "sender", configMINIMAL_STACK_SIZE, NULL, 1, NULL ); /* Start the scheduler. */ vTaskStartScheduler(); /* As the scheduler has been started we should never get here! */ return 0; }
/* Create all the demo tasks then start the scheduler. */ void main( void ) { /* Just sets up the LED outputs. */ prvSetupHardware(); /* Standard demo tasks. */ vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartQueuePeekTasks(); /* Create the check task as described at the top of this file. */ xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, mainCHECK_PARAMETER, mainCHECK_TASK_PRIORITY, NULL ); /* Create the RegTest tasks as described at the top of this file. */ xTaskCreate( vRegTest1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); xTaskCreate( vRegTest2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); #ifdef __IAR_V850ES_Fx3__ { /* The extra IO required for the com test and led flashing tasks is only available on the application board, not the target boards. */ vAltStartComTestTasks( mainCOMTEST_PRIORITY, mainBAUD_RATE, mainCOMTEST_LED ); vStartLEDFlashTasks( mainFLASH_PRIORITY ); /* The Fx3 also has enough RAM to run loads more tasks. */ vStartRecursiveMutexTasks(); vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); } #endif /* 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 ); /* Start the scheduler. */ vTaskStartScheduler(); /* If this line is reached then vTaskStartScheduler() returned because there was insufficient heap memory remaining for the idle task to be created. */ for( ;; ); }
void __attribute__((noreturn)) mainloop (void) { prvSetupHardware (); vLedInit(); xTaskCreate (vUSBCDCTask, (signed portCHAR *) "USB", TASK_USB_STACK, NULL, TASK_USB_PRIORITY, NULL); vCmdInit(); vInitProtocolLayer(); vLedSetGreen(0); vTaskStartScheduler (); while(1); }
int main( void ) { #ifdef DEBUG debug(); #endif prvSetupHardware(); /* 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 ); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartLEDFlashTasks( mainFLASH_TASK_PRIORITY ); vStartQueuePeekTasks(); vStartRecursiveMutexTasks(); /* Create the uIP task. The WEB server runs in this task. */ xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); /* Create the queue used by the LCD task. Messages for display on the LCD are received via this queue. */ xLCDQueue = xQueueCreate( mainQUEUE_SIZE, sizeof( char * ) ); /* Start the LCD gatekeeper task - as described in the comments at the top of this file. */ xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE * 2, NULL, mainLCD_TASK_PRIORITY, NULL ); /* Configure the high frequency interrupt used to measure the interrupt jitter time. When debugging it can be helpful to comment this line out to prevent the debugger repeatedly going into the interrupt service routine. */ vSetupHighFrequencyTimer(); /* Start the scheduler. */ vTaskStartScheduler(); /* Will only get here if there was insufficient memory to create the idle task. The idle task is created within vTaskStartScheduler(). */ for( ;; ); }
/* See the documentation page for this demo on the FreeRTOS.org web site for full information - including hardware setup requirements. */ int main( void ) { /* Prepare the hardware to run this demo. */ prvSetupHardware(); /* The configCREATE_LOW_POWER_DEMO setting is described at the top of this file. */ #if configCREATE_LOW_POWER_DEMO == 1 { main_low_power(); } #else { main_full(); } #endif return 0; }
/** * \brief Run USART unit tests */ int main(void) { /* Prepare the hardware to run this demo. */ prvSetupHardware(); /* Create the test task. */ create_usart_tasks(BOARD_USART, 1024, tskIDLE_PRIORITY); /* Start the RTOS scheduler. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created. See the memory management section on the FreeRTOS web site for more details. */ for (;;) { } }
int main( void ) { /* Configure the hardware for use by this demo. */ prvSetupHardware(); //xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); //make a task for UART char ip_address[32]; LCD_Init(); LCD_ClearScreen(); sprintf(ip_address , "IP Address: %d.%d.%d.%d",configIP_ADDR0,configIP_ADDR1,configIP_ADDR2,configIP_ADDR3); LCD_PrintText(ip_address); //xTaskCreate( vUARTTask, ( signed char * ) "UART_Modem", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); /* Start the scheduler so the created tasks start executing. */ xTaskCreate( vLEDTask, ( signed char * ) "LED_TOGGOLE", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); xTaskCreate( vLCDTask, ( signed char * ) "LCD_DISPLAY", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY+1, NULL ); //xTaskCreate( vUSBTask, ( signed char * ) "USB_Device", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); xTaskCreate( usb_host_main, ( signed char * ) "USB_Device", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY+3, NULL ); //xTaskCreate( vZigbeeTask, ( signed char * ) "Zigbee", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); vTaskStartScheduler(); /* If all is well we will never reach here as the scheduler will now be running the tasks. If we do reach here then it is likely that there was insufficient heap memory available for a resource to be created. */ for( ;; ); return 0; }
int main( void ) { /* Prepare the hardware to run this demo. */ prvSetupHardware(); /* The configCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ #if configCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 { main_blinky(); } #else { main_full(); } #endif return 0; }
/* The main function */ int main(void) { prvSetupHardware(); xTaskCreate(prvLedBlink1,(signed char*)"LED",configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL); xTaskCreate(prvLedBlink2,(signed char*)"LED",configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL); xTaskCreate(prvLedBlink3,(signed char*)"LED",configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 3, NULL); xTaskCreate(prvLedBlink4,(signed char*)"LED",configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 4, NULL); /* Start the scheduler. */ vTaskStartScheduler(); while(1); }
/** * \brief Main code entry point. */ int main( void ) { xTimerHandle xMonitorTimer; /* Prepare the hardware */ prvSetupHardware(); /* Init Prime Stack */ vPrimeStackInitTask(); /* Configure console */ configure_dbg_console(); puts(STRING_HEADER); /* Debug port for AppEmu */ if (!pio_get(PIN_APPEMU_PIO, PIN_APPEMU_TYPE, PIN_APPEMU_MASK)) { /* Init AppEmu Application */ vAppEmuInitTask(); } /* Create timer to monitor tasks execution */ xMonitorTimer = xTimerCreate( (const signed char *const)"Monitor timer", SIGNALLING_TIMER_RATE, pdTRUE, NULL, _prime_signalling ); configASSERT(xMonitorTimer); xTimerStart(xMonitorTimer, SIGNALLING_TIMER_RATE); /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following * line will never be reached. If the following line does execute, then * there was insufficient FreeRTOS heap memory available for the idle * and/or * timer tasks to be created. See the memory management section on the * FreeRTOS web site for more details. */ for (;;) { } }
/********************************************************************************************* * Setup hardware/software *********************************************************************************************/ void prvSetupTask( void *pvParameters ) { // Setup hardware prvSetupHardware(); // Test LEDs and indicate program is starting prvBlinkLeds(); // Setup WiFi connection prvSetupWifi(); // Set mode to allModes my_mode = allModes; // Iterate through each SAV to initialize parameters uint8_t sav; for(sav=0; sav<NUMBER_SAV; sav++) { // Set the SAVs default mode // mode_savs[sav] = mode1; // TODO: change back to default mode_savs[sav] = mode2; // Mark the WiFi channels as uninitialized wifi_channel[sav] = 0xFF; // Initialize all SAVs as inactive wifi_channel_active[sav] = FALSE; } // Indicate that the next channel to be assigned is channel 0 wifi_next_channel = 0; // Create queue for packets xPacketQueue = xQueueCreate( maxPacketQueueLength, MAX_LENGTH*sizeof(uint8_t) ); // Create initial task to connect to Base Station // xTaskCreate( prvConnectTask, "", 300 * sizeof(uint8_t), NULL, connectPriority, xConnectHandle ); xTaskCreate( prvTrafficLightTask, "", 600 * sizeof(uint8_t), NULL, trafficLightPriority, xTrafficLightHandle ); // Delete this task vTaskDelete( xSetupHandle ); }
/** * \brief Main code entry point. */ int main( void ) { /* Prepare the hardware */ prvSetupHardware(); /* Init Prime Stack OSS */ vPrimeStackInitTask(); /* Configure console */ configure_dbg_console(); puts(STRING_HEADER); /* Create timer to update counters in phy layer */ xSignallingTimer = xTimerCreate((const signed char *const)"Signal T", /* Debug name **/ SIGNALLING_TIMER_RATE, /* The timer period. */ pdTRUE, /* This is an auto-reload * timer, so xAutoReload is set * to pdTRUE. */ NULL, /* The timer does not use its * ID, so the ID is just set to * NULL. */ _prime_signalling /* The function that is * called each time the *timer * expires. */ ); configASSERT(xSignallingTimer); /* Start signalling timer */ xTimerStart(xSignallingTimer, SIGNALLING_TIMER_RATE); /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following * line will never be reached. If the following line does execute, then * there was insufficient FreeRTOS heap memory available for the idle * and/or * timer tasks to be created. See the memory management section on the * FreeRTOS web site for more details. */ for (;;) { } }
void main( void ) { /* Configure the NVIC, LED outputs and button inputs. */ prvSetupHardware(); /* Create the timers that are specific to this demo - other timers are created as part of the standard demo within vStartTimerDemoTask. */ prvCreateDemoSpecificTimers(); /* Create a lot of 'standard demo' tasks. Nearly 40 tasks are created in this demo. For a much simpler demo, select the 'blinky' build configuration. */ vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); vCreateBlockTimeTasks(); vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); vStartQueuePeekTasks(); vStartRecursiveMutexTasks(); vStartTimerDemoTask( mainTIMER_TEST_PERIOD ); vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); vStartCountingSemaphoreTasks(); vStartDynamicPriorityTasks(); /* The web server task. */ xTaskCreate( vuIP_Task, "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL ); /* 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 ); /* Start the tasks and timers running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then there was insufficient FreeRTOS heap memory available for the idle and/or timer tasks to be created. See the memory management section on the FreeRTOS web site for more details. */ for( ;; ); }
void main( void ) { /* Configure the hardware for use by this demo. */ prvSetupHardware(); /* Create the uIP task. The WEB server runs in this task. */ xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainBASIC_WEB_STACK_SIZE, ( void * ) NULL, mainUIP_TASK_PRIORITY, NULL ); //***xTaskCreate( prvPrintTask, ( signed portCHAR * ) "PRINTF", 300, NULL, mainCHECK_TASK_PRIORITY, NULL ); /* Start the scheduler. */ vTaskStartScheduler(); /*small test*/ printf("Error: insufficient memory\n"); /* Will only get here if there was insufficient memory to create the idle task. The idle task is created within vTaskStartScheduler(). */ for( ;; ); }
int main( void ) { /* Configure the hardware ready to run the demo. */ prvSetupHardware(); /* The mainSELECTED_APPLICATION setting is described at the top of this file. */ #if( mainSELECTED_APPLICATION == 0 ) { main_blinky(); } #elif( mainSELECTED_APPLICATION == 1 ) { main_full(); } #endif /* Don't expect to reach here. */ return 0; }
int main( void ) { /* Configure the hardware ready to run the demo. */ prvSetupHardware(); /* The configCREATE_LOW_POWER_DEMO setting is described at the top of this file. */ #if( configCREATE_LOW_POWER_DEMO == 1 ) { main_low_power(); } #else { main_full(); } #endif /* Should not get here. */ return 0; }
int main( void ) { prvSetupHardware(); PRINTF("hello from freeRTOS...\n"); xTaskCreate( prvCheckTask, "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); xTaskCreate( prvCheckTask2, "Check2", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY , NULL ); /* Start the scheduler. */ vTaskStartScheduler(); /* Will only get here if there was not enough heap space to create the idle task. */ return 0; }
int main( void ) { /* Configure the hardware ready to run the demo. */ prvSetupHardware(); /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) { main_blinky(); } #else { main_full(); } #endif /* Don't expect to reach here. */ return 0; }
/************************************************************************* * Please ensure to read http://www.freertos.org/portLM3Sxxxx_Eclipse.html * which provides information on configuring and running this demo for the * various Luminary Micro EKs. *************************************************************************/ int main( void ) { prvSetupHardware(); /* Create the uIP task if running on a processor that includes a MAC and PHY. */ if( SysCtlPeripheralPresent( SYSCTL_PERIPH_ETH ) ) { xTaskCreate( ethernetThread, ( signed portCHAR * ) "uIP", mainBASIC_TELNET_STACK_SIZE, NULL, CHECK_TASK_PRIORITY , NULL ); } if (pdPASS != xTaskCreate( console, ( signed portCHAR * ) "CONS", SIM_TASK_STACK_SIZE, NULL, CHECK_TASK_PRIORITY , NULL )) { LWIPDebug("Cant create console!"); } vTaskStartScheduler(); // Start the scheduler. /* Will only get here if there was insufficient memory to create the idle task. */ for( ;; ); return 0; }
/** * @brief: Main program. */ int main() { prvSetupHardware(); // While usually dynamic memory is not a good practice in an embedded program, // this task is allocated on the heap only to test if the low level layer works fine. // (linker script and runtime support) g_pLed1Task = new CHelloWorld(GPIOD, GPIO_Pin_13, 2000); g_pLed1Task->Create("Led1", configMINIMAL_STACK_SIZE, mainFLASH_TASK_PRIORITY); g_Led2Task.Create("Led2", configMINIMAL_STACK_SIZE, 0);//mainFLASH_TASK_PRIORITY); g_HeapTestTask.Create("HT", configMINIMAL_STACK_SIZE, 3); g_HeapTestMonitorTask.Create("HTM", 3*configMINIMAL_STACK_SIZE, 5); // Static task object static CHelloWorld led3Task(GPIOD, GPIO_Pin_3 | GPIO_Pin_4, 3000); led3Task.Create("Led3", configMINIMAL_STACK_SIZE, mainFLASH_TASK_PRIORITY); CSharedResourceEditor::StartGuardTestClass(); g_MessageTestTask.Create("msg_test", configMINIMAL_STACK_SIZE*2, 4); static CMessageProducerTask s_MessageProduceTask(&g_MessageTestTask); s_MessageProduceTask.Create("msg_prod", configMINIMAL_STACK_SIZE*2, 3); g_checkTask.Create("Check", configMINIMAL_STACK_SIZE, configMAX_PRIORITIES-1); ABlockQ::StartBlockingQueueTasks(&g_checkTask, mainBLOCK_Q_PRIORITY); CInteger::StartIntegerMathTasks(&g_checkTask, mainINTEGER_TASK_PRIORITY); APollQ::StartPolledQueueTasks(&g_checkTask, mainQUEUE_POLL_PRIORITY); CSemTest::StartSemTestTasks(&g_checkTask, mainSEM_TEST_PRIORITY); static CTimerTestTask s_timerTask; s_timerTask.Create("timer_t", configMINIMAL_STACK_SIZE*2, mainTIMER_TEST_PRIORITY); CFreeRTOS::InitHardwareForManagedTasks(); CFreeRTOS::StartScheduler(); while(1); return 0; }
/** * \brief Main code entry point. */ int main( void ) { xTimerHandle xMonitorTimer; /* Prepare the hardware */ prvSetupHardware(); /* Init Prime Stack OSS */ vPrimeStackInitTask(); /* Configure console */ configure_dbg_console(); puts(STRING_HEADER); /* Create timer to monitor tasks execution */ xMonitorTimer = xTimerCreate( (const signed char *const)"Monitor timer", /* Text name for * debugging. **/ MONITOR_TIMER_RATE, /* The timer period. */ pdTRUE, /* This is an auto-reload timer, so xAutoReload * is set to pdTRUE.*/ NULL, /* The timer does not use its ID, so the ID is * just set to NULL. */ prvProcessMonitorTasks /* Function called each time the * timer expires. */ ); configASSERT(xMonitorTimer); xTimerStart(xMonitorTimer, MONITOR_BLOCK_TIME); /* Start the tasks and timer running. */ vTaskStartScheduler(); /* If all is well, the scheduler will now be running, and the following * line will never be reached. If the following line does execute, then * there was insufficient FreeRTOS heap memory available for the idle * and/or * timer tasks to be created. See the memory management section on the * FreeRTOS web site for more details. */ for (;;) { } }
/* * Entry point of program execution */ int main( void ) { prvSetupHardware(); IOE_Config(); #ifdef CONFIG_ENABLE_PRINTER printQueue = xQueueCreate(128, 1); #endif setup_buttons(); initDisplay(); ipc_measure_init(); if(pdFALSE == ipc_init()) { ipc_watchdog_signal_error(0); } if(pdFALSE == task_measure_init()) { ipc_watchdog_signal_error(0); } #ifdef CONFIG_ENABLE_PRINTER xTaskCreate(printTask, "print", 100, NULL, 1, NULL); #endif xTaskCreate(task_controller, "Controller", 100, NULL, 1, NULL); xTaskCreate(task_watchdog, "Watchdog driver", 100, NULL, 1, NULL); xTaskCreate(task_input_gpio, "Input driver for GPIO", 100, NULL, 1, NULL); xTaskCreate(task_input_touch, "Input driver for touchscreen", 200, NULL, 1, NULL); xTaskCreate(task_display, "Display", 300, NULL, 1, NULL); xTaskCreate(task_measure_cmd, "ADC-driver: controller", 100, NULL, 1, NULL); xTaskCreate(task_measure, "ADC-driver: IRQ interface", 100, NULL, 1, NULL); vTaskStartScheduler(); ipc_watchdog_signal_error(0); while(1); }
void main( void ) { /* Setup the MCU IO. */ prvSetupHardware(); /* Create the tasks and co-routines that toggle the display segments. */ vCreateFlashTasksAndCoRoutines(); /* Create a 'dice' task to control the left hand display. */ xTaskCreate( vDiceTask, ( signed char * ) "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL ); /* Create a 'dice' task to control the right hand display. */ xTaskCreate( vDiceTask, ( signed char * ) "Dice2", configMINIMAL_STACK_SIZE, ( void * ) configRIGHT_DISPLAY, mainDICE_PRIORITY, NULL ); /* Start the scheduler running. */ vTaskStartScheduler(); /* If this loop is executed then there was insufficient heap memory for the idle task to be created - causing vTaskStartScheduler() to return. */ while( 1 ); }
int main( void ) { /* See http://www.FreeRTOS.org/MSP430FR5969_Free_RTOS_Demo.html */ /* Configure the hardware ready to run the demo. */ prvSetupHardware(); /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top of this file. */ #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 ) { main_blinky(); } #else { main_full(); } #endif return 0; }