2020#endif
2121
2222extern TIM_TypeDef* Scheduler_global_timer;
23+ void Scheduler_global_timer_callback (void * raw);
24+ void Scheduler_start (void );
2325
2426struct Scheduler {
2527 using callback_t = void (*)();
@@ -28,7 +30,8 @@ struct Scheduler {
2830 // if it isn't it could theoretically be used as an id in set_timeout
2931 static constexpr uint32_t INVALID_ID = 2 * kMaxTasks ;
3032
31- static void start ();
33+ // temporary, will be removed
34+ [[deprecated]] static inline void start () {}
3235 static void update ();
3336 static inline uint64_t get_global_tick () {
3437 return global_tick_us_ + Scheduler_global_timer->CNT ;
@@ -42,6 +45,8 @@ struct Scheduler {
4245
4346 // internal
4447 static void on_timer_update ();
48+ static void schedule_next_interval ();
49+ static constexpr uint32_t FREQUENCY = 1'000'000u ; // 1 MHz -> 1us precision
4550#ifndef SIM_ON
4651private:
4752#endif
@@ -60,7 +65,6 @@ struct Scheduler {
6065 static_assert (INVALID_ID >= kMaxTasks , " INVALID_ID must not be a possible task id" );
6166
6267 static_assert ((kMaxTasks & (kMaxTasks - 1 )) == 0 , " kMaxTasks must be a power of two" );
63- static constexpr uint32_t FREQUENCY = 1'000'000u ; // 1 MHz -> 1us precision
6468
6569 static std::array<Task, kMaxTasks > tasks_;
6670 static_assert (
@@ -86,8 +90,6 @@ struct Scheduler {
8690 static inline void release_slot (uint8_t id);
8791 static void insert_sorted (uint8_t id);
8892 static void remove_sorted (uint8_t id);
89- static void schedule_next_interval ();
90- static inline void configure_timer_for_interval (uint32_t microseconds);
9193
9294 // helpers
9395 static inline uint8_t get_at (uint8_t idx);
0 commit comments