Replies: 3 comments 5 replies
-
The So the idea is that you can not include this module in your project via a custom BSP and then replace this module with your own You can probably even make it a |
Beta Was this translation helpful? Give feedback.
-
Thanks i will look into it. I noticed the deprecated volatile's in modm::platform::clock the correct thing would be to replace them with atomic's with the correct memory_order for performance reasons (platform dependent). I know that atomic's have normal operators but i don't use them, they are not fast on all platforms and you can't see something special is going then reading the code. Do you want a patch? static std::atomic_uint32_t milli_time{0};
static std::atomic_uint32_t micro_time{0};
static std::atomic_uint8_t interrupt{false};
//Writing
milli_time.fetch_add(systick_step, std::memory_order_release);
//Reading
ms = milli_time.load(std::memory_order_acquire); |
Beta Was this translation helpful? Give feedback.
-
Atomics will only prevent a race condition then now() is called in a legal C++20 way (I think volatile will continue work in GCC but you have no guarantee). It won't affect the "jump back" problem. |
Beta Was this translation helpful? Give feedback.
-
It is annoying that modm preoccupies the systick handler. I have a project where it's needed elsewhere and the only option in the moment is to rename it and call modm's handler from external code. It's not difficult to create a option in lbuild to implement such a feature or to improve the systick clock code. I can see there is a "custom irq handler" project, Is this the strategy to solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions