Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] implementation of templated timer tick #943

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions examples/ArmTimerCallbacks - C++/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ const int N_TIMERS = 4;

etl::callback_timer<N_TIMERS> callback_timer;

etl::timer::id::type short_toggle;
etl::timer::id::type long_toggle;
etl::timer::id::type start_timers;
etl::timer::id::type swap_timers;
etl::timer<>::id::type short_toggle;
etl::timer<>::id::type long_toggle;
etl::timer<>::id::type start_timers;
etl::timer<>::id::type swap_timers;

/*----------------------------------------------------------------------------
* SystemCoreClockConfigure: configure SystemCoreClock using HSI
Expand Down Expand Up @@ -131,10 +131,10 @@ int main()

// The LEDs will start flashing fast after 2 seconds.
// After another 5 seconds they will start flashing slower.
short_toggle = callback_timer.register_timer(LedToggle, 50, etl::timer::mode::REPEATING);
long_toggle = callback_timer.register_timer(LedToggle, 100, etl::timer::mode::REPEATING);
start_timers = callback_timer.register_timer(StartTimers, 2000, etl::timer::mode::SINGLE_SHOT);
swap_timers = callback_timer.register_timer(SwapTimers, 1500, etl::timer::mode::SINGLE_SHOT);
short_toggle = callback_timer.register_timer(LedToggle, 50, etl::timer<>::mode::REPEATING);
long_toggle = callback_timer.register_timer(LedToggle, 100, etl::timer<>::mode::REPEATING);
start_timers = callback_timer.register_timer(StartTimers, 2000, etl::timer<>::mode::SINGLE_SHOT);
swap_timers = callback_timer.register_timer(SwapTimers, 1500, etl::timer<>::mode::SINGLE_SHOT);

SysTick_Config(SystemCoreClock / 1000);

Expand Down
Loading