-
Notifications
You must be signed in to change notification settings - Fork 3k
Tests for SysTimer (the idle loop timer for tickless mode) #5548
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
Conversation
Regarding CI test runs -- this test suite needs first to be compiled with mbed test -t GCC_ARM -m NUCLEO_L476RG -n tests-mbedmicro-rtos-mbed-systimer -DMBED_TICKLESS --compile and then run without mbed test -t GCC_ARM -m NUCLEO_L476RG -n tests-mbedmicro-rtos-mbed-systimer --run -v Where do I need to include this setup? |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR confused me first. The headline is about tests, but this introduces a new API: We still do not have here How does this addition stands against
This is bringing new Timer to the user space. How does this compare to RTOSTimer, EventQueue, Timer/LowPowerTimer? |
@0xc0170 This particular PR adds tests for a class named
This is only to make this class accessible for test code.
Apart from the class name -- it's unrelated.
True. Maybe this could be avoided by putting class files some other place. Could anyone point the appropriate directory? Would |
I added a minor release version as minor releases may contain additions to the public set of API's. Patch releases may not contain additions to the public API set. |
I think this is waiting on clarification/review from @0xc0170 |
Ah! I've missed the directory change. @0xc0170 good catch! Shall we move it to |
@fkjagodzinski What do you think? This would work (having it not part of public API, no inclusion besides the file that is using this internal API) and stating in the docs that this is internal detail. |
9822466
to
95b3887
Compare
Thanks for the comments! Here is the update:
|
rtos/TARGET_CORTEX/mbed_rtx_idle.cpp
Outdated
|
||
/// Enable System Timer. | ||
int32_t OS_Tick_Enable (void) | ||
{ | ||
// Do not use SingletonPtr since this relies on the RTOS | ||
if (NULL == os_timer) { | ||
os_timer = new (os_timer_data) RtosTimer(); | ||
os_timer = new (os_timer_data) rtos::SysTimer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we split the constructor into 2 calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that to avoid manipulating SysTick
/ IRQ
registers while running tests. I also extracted set_irq_pending()
from handler()
for same reason.
#include "platform/NonCopyable.h" | ||
#include "drivers/TimerEvent.h" | ||
|
||
namespace rtos { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the test code, and here. This is in the rtos namespace. Is enough just docs note ?
I would propose to create own namespace for this within rtos, to show the intent, internal namespace within rtos: rtos::internal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I added an additional internal
namespace as suggested.
/morph build |
Build : SUCCESSBuild number : 629 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 256 |
Test : FAILUREBuild number : 453 |
@fkjagodzinski these tests should only be enabled for platforms defining TICKLESS macro. |
b93e5fd
to
55d06ab
Compare
Update:
Regarding test failures on NRF51_DK -- #5284 has to be resolved first. |
Exporter Build : SUCCESSBuild number : 941 |
RtosTimer class introduced with tickless support in ARMmbed#4991 had to be renamed because that name was already present in rtos namespace.
55d06ab
to
d83ed63
Compare
/morph build |
Build : SUCCESSBuild number : 1299 Triggering tests/morph test |
Build : SUCCESSBuild number : 1300 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 960 |
1 similar comment
Exporter Build : SUCCESSBuild number : 960 |
/morph build |
@fkjagodzinski Sorry about the multiple builds. Stale web pages don't auto-refresh, making me think I still need to invoke commands. |
Build : SUCCESSBuild number : 1304 Triggering tests/morph test |
Test : SUCCESSBuild number : 1085 |
Exporter Build : SUCCESSBuild number : 964 |
Test : SUCCESSBuild number : 1088 |
Description
Add tests for an
RtosTimer
class introduced with TICKLESS mode support in #4991.RtosTimer
class frommbed-os/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp
Line 49 in a519b84
rtos/SysTimer
,Status
READY
Issues to be resolved before merge:
Fire interrupt function broken for nrf5x targets #5284