From rkit
FreeRTOS 태스크/동기화 설계. xTaskCreate, Queue, Semaphore, Mutex, 스택 사이징. Triggers: FreeRTOS, RTOS, task, queue, semaphore, mutex, 태스크, タスク, 任务
npx claudepluginhub solitasroh/rkit --plugin rkitThis skill is limited to using the following tools:
```c
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
// Static allocation (recommended for safety-critical)
StaticTask_t xTaskBuffer;
StackType_t xStack[256]; // 256 words = 1024 bytes on 32-bit
TaskHandle_t xHandle = xTaskCreateStatic(vMyTask, "MyTask",
256, NULL, tskIDLE_PRIORITY + 2, xStack, &xTaskBuffer);
// Dynamic allocation
xTaskCreate(vMyTask, "MyTask", 256, NULL, 2, &xHandle);
Required Stack = Worst-case call depth (bytes)
+ Local variables (largest function)
+ ISR nesting overhead (if applicable)
+ FreeRTOS context save (64-100 bytes on Cortex-M)
+ Safety margin (20%)
Typical sizes:
Simple task (GPIO toggle): 128 words (512 bytes)
UART handler: 256 words (1024 bytes)
Sensor processing: 512 words (2048 bytes)
Network stack (LwIP): 1024+ words (4096+ bytes)
QueueHandle_t xQueue = xQueueCreate(10, sizeof(SensorData_t));
xQueueSend(xQueue, &data, pdMS_TO_TICKS(100)); // Producer
xQueueReceive(xQueue, &data, portMAX_DELAY); // Consumer
SemaphoreHandle_t xSem = xSemaphoreCreateBinary();
// In ISR:
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR(xSem, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
// In Task:
xSemaphoreTake(xSem, portMAX_DELAY);
SemaphoreHandle_t xMutex = xSemaphoreCreateMutex();
if (xSemaphoreTake(xMutex, pdMS_TO_TICKS(100)) == pdTRUE) {
// Access shared resource
xSemaphoreGive(xMutex);
}
Middlewares/Third_Party/FreeRTOS/FreeRTOSConfig.h (configTOTAL_HEAP_SIZE, configMINIMAL_STACK_SIZE)