mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
A tiny bit simpler pios.c, FreeRTOS is working and flashing an LED. Fat stuff needs a timer, Freertos is a nice way to supply that so a task is created and running. Need to rework the fat stuff so it is FreeRTOS friendly.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@111 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
08fc0ac743
commit
8cb7ce6a86
@ -42,6 +42,7 @@ void vApplicationIdleHook(void);
|
|||||||
|
|
||||||
/* Function Prototypes */
|
/* Function Prototypes */
|
||||||
void TestTask( void *pvParameters );
|
void TestTask( void *pvParameters );
|
||||||
|
void DiskTask( void *pvParameters );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function
|
* Main function
|
||||||
@ -53,6 +54,9 @@ int main()
|
|||||||
enables the LEDs. */
|
enables the LEDs. */
|
||||||
PIOS_SYS_Init();
|
PIOS_SYS_Init();
|
||||||
|
|
||||||
|
xTaskCreate( TestTask, ( signed portCHAR * ) "Test", configMINIMAL_STACK_SIZE , NULL, 2, NULL );
|
||||||
|
xTaskCreate( DiskTask, ( signed portCHAR * ) "Disk", configMINIMAL_STACK_SIZE , NULL, 4, NULL );
|
||||||
|
|
||||||
/* Enables the SDCard */
|
/* Enables the SDCard */
|
||||||
// PIOS_SDCARD_Init();
|
// PIOS_SDCARD_Init();
|
||||||
|
|
||||||
@ -69,8 +73,6 @@ int main()
|
|||||||
/* Initialise OpenPilot application */
|
/* Initialise OpenPilot application */
|
||||||
// OpenPilotInit();
|
// OpenPilotInit();
|
||||||
|
|
||||||
xTaskCreate( TestTask, ( signed portCHAR * ) "Test", 128 , NULL, 2, NULL );
|
|
||||||
|
|
||||||
/* Start the FreeRTOS scheduler */
|
/* Start the FreeRTOS scheduler */
|
||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
|
|
||||||
@ -91,6 +93,18 @@ const portTickType xDelay = 500 / portTICK_RATE_MS;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DiskTask( void *pvParameters )
|
||||||
|
{
|
||||||
|
const portTickType xDelay = 10 / portTICK_RATE_MS;
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
disk_timerproc();
|
||||||
|
vTaskDelay(xDelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Idle hook function
|
* Idle hook function
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user