1#include "../../Inc/Scheduler/PriorityQueue.h"
17 pq->
nodes[index / 2] = temp;
30 while (2 * index <= pq->size) {
bool PQPeek(PriorityQueue *pq, Task *task)
Peeks at the highest priority task in the priority queue without removing it.
bool PQIsEmpty(PriorityQueue *pq)
Checks if the priority queue is empty.
void heapifyDown(PriorityQueue *pq, int index)
Restores the heap property by moving the node at the given index down.
void heapifyUp(PriorityQueue *pq, int index)
Restores the heap property by moving the node at the given index up.
bool PQIsFull(PriorityQueue *pq)
Checks if the priority queue is full.
bool PQPop(PriorityQueue *pq, Task *task)
Pops the highest priority task from the priority queue.
bool PQPush(PriorityQueue *pq, Task task, int priority)
Pushes a task with a given priority onto the priority queue.
void PQInit(PriorityQueue *pq)
Initializes the priority queue.
PQNode nodes[MAX_SENSORS+1]