|
STM32 Traffic Control
|
Public API for circular queue implementation. More...
#include <stdint.h>#include <stdbool.h>#include "stm32f446xx.h"Go to the source code of this file.
Functions | |
| bool | queue_is_empty (void) |
| Check if the traffic light request queue is empty. | |
| bool | queue_is_full (void) |
| Check if the traffic light request queue is full. | |
| void | queue_enqueue (uint32_t light_pair) |
| Add a traffic light pair request to the queue. | |
| int32_t | queue_dequeue (void) |
| Remove and return the next traffic light pair request. | |
Public API for circular queue implementation.
| int32_t queue_dequeue | ( | void | ) |
Remove and return the next traffic light pair request.
Retrieves the front element of the queue and updates the queue pointers. Returns -1 if the queue is empty.
| void queue_enqueue | ( | uint32_t | lightPair | ) |
Add a traffic light pair request to the queue.
If the queue is not full, the request is added at the rear of the queue. The queue is circular and wraps around automatically.
| lightPair | ID of the traffic light pair to enqueue. |
| bool queue_is_empty | ( | void | ) |
Check if the traffic light request queue is empty.
| bool queue_is_full | ( | void | ) |
Check if the traffic light request queue is full.