feat: initial
This commit is contained in:
45
README.md
Normal file → Executable file
45
README.md
Normal file → Executable file
@@ -1,3 +1,44 @@
|
||||
# zh_avr_free_rtos
|
||||
# FreeRTOS (v11.1) port for AVR 8bit microcontrollers
|
||||
|
||||
FreeRTOS (v11.1) port for AVR 8bit microcontrollers.
|
||||
## Using
|
||||
|
||||
In an existing project, run the following command to install the component:
|
||||
|
||||
```text
|
||||
cd ../your_project/lib
|
||||
git clone http://git.zh.com.ru/alexey.zholtikov/zh_avr_free_rtos
|
||||
```
|
||||
|
||||
In the application, add the component:
|
||||
|
||||
```c
|
||||
#include "FreeRTOS.h"
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Led blink:
|
||||
|
||||
```c
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "avr/io.h"
|
||||
|
||||
void led_flash_task(void *pvParameters)
|
||||
{
|
||||
DDRB |= (1 << PORTB5);
|
||||
for (;;)
|
||||
{
|
||||
PORTB ^= (1 << PORTB5);
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
xTaskCreate(led_flash_task, "led flash task", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL);
|
||||
vTaskStartScheduler();
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user