Skip to content

Feat/TimerDomain#547

Merged
jorgesg82 merged 283 commits intodevelopmentfrom
feat/TimerDomain
Jan 22, 2026
Merged

Feat/TimerDomain#547
jorgesg82 merged 283 commits intodevelopmentfrom
feat/TimerDomain

Conversation

@victor-Lopez25
Copy link
Copy Markdown
Contributor

@victor-Lopez25 victor-Lopez25 commented Dec 29, 2025

This PR features:

  • The first implementation of the Scheduler before making it use a TimerDomain
  • TimerDomain.hpp and TimerDomain.cpp (pin checking and usage is a work in progress)

Here is an example of main.cpp to test the usage of TimerDomain:

#include "main.h"
#include "ST-LIB.hpp"

using ST_LIB::TimerDomain;
using ST_LIB::TimerRequest;
using ST_LIB::DigitalOutputDomain;

struct ToggleLed_Data {
    DigitalOutputDomain::Instance &green_led;
};

void toggle_led(void *rawdata) {
    ToggleLed_Data *data = (ToggleLed_Data*)rawdata;
    data->green_led.toggle();
}

constexpr TimerDomain::Timer general_purpose_timer{TimerRequest::AnyGeneralPurpose, TimerDomain::CountingMode::UP, {'t','i','m','e','r','g','p','\0'}};
constexpr DigitalOutputDomain::DigitalOutput led2{ST_LIB::PE1};
int main(void) {
    using myBoard = ST_LIB::Board<general_purpose_timer, led2>;
    myBoard::init();

    DigitalOutputDomain::Instance &green_led = myBoard::instance_of<led2>();
    auto tim_gp1 = ST_LIB::TimerWrapper<general_purpose_timer>(myBoard::instance_of<general_purpose_timer>());
    (void)tim_gp1;
    ToggleLed_Data tlData = {green_led};
    tim_gp1.configure16bit<200*100>(toggle_led, &tlData, 20000);
    tim_gp1.enable_nvic();
    tim_gp1.enable_update_interrupt();

    for(;;) {
        __NOP();
    }
}

void Error_Handler(void) {
    ErrorHandler("HAL error handler triggered");
    while (1) {
    }
}

g0nz4I0 and others added 30 commits December 3, 2025 16:54
#534 (comment)

Co-authored-by: Jorge Sáez <125664643+jorgesg82@users.noreply.github.com>
Rebased from remotes/origin/MockTim
@victor-Lopez25 victor-Lopez25 marked this pull request as ready for review January 20, 2026 20:31
@jorgesg82
Copy link
Copy Markdown
Contributor

I'm not gonna review 2k codelines. Let's merge and we will make tests at some point

@jorgesg82 jorgesg82 merged commit f62d715 into development Jan 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants