<commit_before>#include "OS.hpp"
#include <port/port.hpp>

PriorityQueue_t<TaskStruct_t, MAX_TASKS> TaskQueue;
TaskStruct_t ActrualRunningTaskStruct;

void sys::boot() {
    InitSysTick();
    TaskStruct_t t = TaskQueue.front();
    ContextSet(&t.lowLevel);

    // Now we will execute this task (jump to first task)
    ExecutePendingTask();  // This will also enable interrupts

    // This will never execute, aber zicher ist zicher!
    while (1) {}
}

void sys::taskCreate(TaskHandler_t taskHandler,
                     uint8_t priority,
                     uint16_t StackSize) {
    TaskStruct_t task;
    task.priority = priority;
    task.lowLevel = TaskAllocate(taskHandler, StackSize);
    TaskQueue.push(task);
}


void sys::ProcSysTick() {
    ContextGet(&ActrualRunningTaskStruct.lowLevel);
    TaskQueue.push(ActrualRunningTaskStruct);
    ActrualRunningTaskStruct = TaskQueue.front();
    TaskQueue.pop();
    ContextSet(&ActrualRunningTaskStruct.lowLevel);
}<commit_msg>OS crash fixup - sys::boot corrected<commit_after>#include "OS.hpp"
#include <port/port.hpp>

PriorityQueue_t<TaskStruct_t, MAX_TASKS> TaskQueue;
TaskStruct_t ActrualRunningTaskStruct;

void sys::boot() {
    InitSysTick();
    ActrualRunningTaskStruct = TaskQueue.front();
	TaskQueue.pop();
    ContextSet(&ActrualRunningTaskStruct.lowLevel);

    // Now we will execute this task (jump to first task)
    ExecutePendingTask();  // This will also enable interrupts

    // This will never execute, aber zicher ist zicher!
    while (1) {}
}

void sys::taskCreate(TaskHandler_t taskHandler,
                     uint8_t priority,
                     uint16_t StackSize) {
    TaskStruct_t task;
    task.priority = priority;
    task.lowLevel = TaskAllocate(taskHandler, StackSize);
    TaskQueue.push(task);
}


void sys::ProcSysTick() {
    ContextGet(&ActrualRunningTaskStruct.lowLevel);
    TaskQueue.push(ActrualRunningTaskStruct);
    ActrualRunningTaskStruct = TaskQueue.front();
    TaskQueue.pop();
    ContextSet(&ActrualRunningTaskStruct.lowLevel);
}
{'fraction_non_alphanumeric': 0.1048780487804878, 'fraction_numerical': 0.003902439024390244, 'mean_word_length': 3.7587006960556844, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2526657', 'n_tokens_mistral': 642, 'n_tokens_neox': 626, 'n_words': 134}