-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SystemMonitor: implement FreeRtosMonitor only if trace facility is set #967
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
SystemMonitor: implement FreeRtosMonitor only if trace facility is set #967
Conversation
|
The definition of the template |
|
yes, without the commit I'd have to implement/stub The only place where this logger is instantiated is in #if configUSE_TRACE_FACILITY == 1
SystemMonitor<FreeRtosMonitor> monitor;
#else
SystemMonitor<DummyMonitor> monitor;
#endifOne thing I just noticed is that we could get rid of the templated System-Monitor class and use just a If this restructure isn't wanted I'll have to stub the |
|
Ok, I understand :) The goal with the template class was to avoid using On the long term, I would like to find a better design to handle multiple platforms but for now, I think your first solution will be the best :
|
9dd6da2 to
c4981b0
Compare
|
With the restructure of
Should I create a separate PR for these And I've split the SystemMonitor into a h and cpp pair, as the implementation of a non-template function shouldn't be in the header. As this could cause errors with the one-definition rule (not here, but generally) Furthermore I've changed the |
c4981b0 to
feeca6b
Compare
|
rebased on current |
InfiniTimeOrg/InfiniTime#967 splits SystemMonitor.h into a h and cpp file. Add the cpp file to the infinisim target.
InfiniTimeOrg/InfiniTime#967 splits SystemMonitor.h into a h and cpp file. Add the cpp file to the infinisim target.
Some components were missing a `nrf_log.h` include. This missing include was accidentally provided by the SystemMonitor.h header, which was included by Systemtask.h
Split SystemMonitor into h and cpp file and move the logging code of the `Process` function into the cpp file. Depending of the `configUSE_TRACE_FACILITY` define from `src/FreeRTOSConfig.h` create either a "FreeRtosMonitor" or a "DummyMonitor". Make the `Process()` function non-const, as the FreeRtosMonitor changes the member variable `lastTick`. In `SystemTask.h` we then only need to use `SystemMonitor`, without knowledge of the `configUSE_TRACE_FACILITY` define.
feeca6b to
9131722
Compare
InfiniTimeOrg/InfiniTime#967 splits SystemMonitor.h into a h and cpp file. Add the cpp file to the infinisim target.
InfiniTimeOrg/InfiniTime#967 splits SystemMonitor.h into a h and cpp file. Add the cpp file to the infinisim target.
No need to implement
SystemMonitor<FreeRtosMonitor>if the variableconfigUSE_TRACE_FACILITYis set to1. Otherwise implement theDummyMonitorclass.