* @brief Priority test callback that uses currentScheduler() and currentTask() * * This callback mimics the example11 pattern by accessing the current scheduler * and task to get task ID and timing information. */
| 142 | * and task to get task ID and timing information. |
| 143 | */ |
| 144 | void priority_test_callback() { |
| 145 | priority_callback_counter++; |
| 146 | |
| 147 | // Use currentScheduler() and currentTask() like in example11 |
| 148 | Scheduler& current_scheduler = Scheduler::currentScheduler(); |
| 149 | Task& current_task = current_scheduler.currentTask(); |
| 150 | |
| 151 | // Record task execution with ID for verification |
| 152 | unsigned int task_id = current_task.getId(); |
| 153 | unsigned long execution_time = millis(); |
| 154 | |
| 155 | priority_execution_times[priority_execution_index++] = execution_time; |
| 156 | |
| 157 | // Create output string with task ID for verification |
| 158 | std::string output = "task_" + std::to_string(task_id) + "_executed"; |
| 159 | priority_test_output.push_back(output); |
| 160 | |
| 161 | std::cout << "Task: " << task_id << " executed at " << execution_time |
| 162 | << "ms, Start delay = " << current_task.getStartDelay() << std::endl; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @brief Medium priority task callback - simulates intermediate priority work |
nothing calls this directly
no test coverage detected