feat: add lab-rv32i-freertos-semaphore-notify card

This commit is contained in:
user
2026-07-21 19:14:20 +02:00
commit 3ae96a0d06
67 changed files with 37159 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# K12 — Semaphores and task notifications
## Position
- Series: FreeRTOS C++
- Lesson: L11, card K12
- Duration: 30 minutes
- Waiter priority 3, signaler priority 2
- Static semaphore controls; notification state in waiter TCB
## Outcome
The student selects a binary semaphore, counting semaphore or direct task
notification from the communication cardinality and state semantics, then
proves blocked/wake transitions and clear/value policy.
## Lesson plan
| Time | Mode | Evidence |
| --- | --- | --- |
| 05 | binary | empty 0, give 1, second give false, take 0 |
| 510 | counting | max/initial 2, take to 1 then 0 |
| 1015 | blocked waiter | third take blocks; signaler observes eBlocked |
| 1520 | release | one give wakes exactly one waiter; token consumed |
| 2025 | notification count | give/take returns 1, state lives in TCB |
| 2530 | notification value | explicit overwrite/wait yields 0xA5A55A5A |
## Acceptance
- binary and counting bounds are enforced;
- both handles equal caller static controls and heap delta is zero;
- waiter is blocked at all three intended waits;
- counting release is consumed immediately, leaving count 0;
- notification give/take returns exactly 1;
- explicit `overwrite` action transfers 0xA5A55A5A;
- event order connects counting block/release and both notification phases;
- target exits with PASS.
## Main traps
1. A semaphore signals availability; it does not carry a data record.
2. Notification targets one specific task/slot, not arbitrary consumers.
3. Clear-on-exit versus decrement changes binary/counting notification meaning.
4. Wrong action or clear mask can silently lose bits/value.
5. Identical wake behavior does not imply identical storage/cardinality.