mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-21 11:54:15 +01:00
OP-1365 fix comments
This commit is contained in:
parent
613910e7cb
commit
fa24d21237
5
.pydevproject
Normal file
5
.pydevproject
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?eclipse-pydev version="1.0"?><pydev_project>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
|
||||||
|
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
|
||||||
|
</pydev_project>
|
@ -44,7 +44,7 @@ extern int8_t pios_instrumentation_last_used_counter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a counter with a new value
|
* Update a counter with a new value
|
||||||
* @param counterIdx index of the counter to update @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
* @param counter_handle handle of the counter to update @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
||||||
* @param newValue the updated value.
|
* @param newValue the updated value.
|
||||||
*/
|
*/
|
||||||
inline void PIOS_Instrumentation_updateCounter(pios_counter_t counter_handle, int32_t newValue)
|
inline void PIOS_Instrumentation_updateCounter(pios_counter_t counter_handle, int32_t newValue)
|
||||||
@ -65,7 +65,7 @@ inline void PIOS_Instrumentation_updateCounter(pios_counter_t counter_handle, in
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine the time duration of a code block, mark the begin of the block. @see PIOS_Instrumentation_TimeEnd
|
* Used to determine the time duration of a code block, mark the begin of the block. @see PIOS_Instrumentation_TimeEnd
|
||||||
* @param counterIdx counterIdx index of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
* @param counter_handle handle of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
||||||
*/
|
*/
|
||||||
inline void PIOS_Instrumentation_TimeStart(pios_counter_t counter_handle)
|
inline void PIOS_Instrumentation_TimeStart(pios_counter_t counter_handle)
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ inline void PIOS_Instrumentation_TimeStart(pios_counter_t counter_handle)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine the time duration of a code block, mark the end of the block. @see PIOS_Instrumentation_TimeStart
|
* Used to determine the time duration of a code block, mark the end of the block. @see PIOS_Instrumentation_TimeStart
|
||||||
* @param counterIdx counterIdx index of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
* @param counter_handle handle of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
||||||
*/
|
*/
|
||||||
inline void PIOS_Instrumentation_TimeEnd(pios_counter_t counter_handle)
|
inline void PIOS_Instrumentation_TimeEnd(pios_counter_t counter_handle)
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ inline void PIOS_Instrumentation_TimeEnd(pios_counter_t counter_handle)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine the mean period between each call to the function
|
* Used to determine the mean period between each call to the function
|
||||||
* @param counterIdx counterIdx index of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
* @param counter_handle handle of the counter @see PIOS_Instrumentation_SearchCounter @see PIOS_Instrumentation_CreateCounter
|
||||||
*/
|
*/
|
||||||
inline void PIOS_Instrumentation_TrackPeriod(pios_counter_t counter_handle)
|
inline void PIOS_Instrumentation_TrackPeriod(pios_counter_t counter_handle)
|
||||||
{
|
{
|
||||||
@ -129,15 +129,16 @@ void PIOS_Instrumentation_Init(int8_t maxCounters);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new counter.
|
* Create a new counter.
|
||||||
* @param id the unique id to assig to the counter
|
* @param id the unique id to assign to the counter
|
||||||
* @return the counter index to be used to manage its content
|
* @return the counter handle to be used to manage its content
|
||||||
*/
|
*/
|
||||||
pios_counter_t PIOS_Instrumentation_CreateCounter(uint32_t id);
|
pios_counter_t PIOS_Instrumentation_CreateCounter(uint32_t id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* search a counter index by its unique Id
|
* search a counter index by its unique Id
|
||||||
* @param id the unique id to assig to the counter
|
* @param id the unique id to assign to the counter.
|
||||||
* @return the counter index to be used to manage its content
|
* If a counter with the same id exists, the previous instance is returned
|
||||||
|
* @return the counter handle to be used to manage its content
|
||||||
*/
|
*/
|
||||||
pios_counter_t PIOS_Instrumentation_SearchCounter(uint32_t id);
|
pios_counter_t PIOS_Instrumentation_SearchCounter(uint32_t id);
|
||||||
|
|
||||||
|
@ -30,50 +30,50 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \par
|
* \par
|
||||||
* This is a collections of helper macros that ease adding instrumentation support.
|
* This is a collections of helper macros that ease adding instrumentation support.
|
||||||
* \par
|
* \par
|
||||||
* Step by step guide:
|
* Step by step guide:
|
||||||
*
|
*
|
||||||
* Define PIOS_INSTRUMENT_MODULE before including this file to enable instrumentation for a module
|
* Define PIOS_INSTRUMENT_MODULE before including this file to enable instrumentation for a module
|
||||||
*
|
*
|
||||||
* <pre>#define PIOS_INSTRUMENT_MODULE
|
* <pre>#define PIOS_INSTRUMENT_MODULE
|
||||||
* #include <pios_instrumentation_helper.h></pre>
|
* #include <pios_instrumentation_helper.h></pre>
|
||||||
*
|
*
|
||||||
* Declare the variables used to hold counter handlers.
|
* Declare the variables used to hold counter handlers.
|
||||||
* Place the following code along all module variables declaration.
|
* Place the following code along all module variables declaration.
|
||||||
* <pre>PERF_DEFINE_COUNTER(counterUpd);
|
* <pre>PERF_DEFINE_COUNTER(counterUpd);
|
||||||
* PERF_DEFINE_COUNTER(counterAccelSamples);
|
* PERF_DEFINE_COUNTER(counterAccelSamples);
|
||||||
* PERF_DEFINE_COUNTER(counterPeriod);
|
* PERF_DEFINE_COUNTER(counterPeriod);
|
||||||
* PERF_DEFINE_COUNTER(counterAtt);</pre>
|
* PERF_DEFINE_COUNTER(counterAtt);</pre>
|
||||||
*
|
*
|
||||||
* Counters needs to be initialized before they are used.
|
* Counters needs to be initialized before they are used.
|
||||||
* The following code needs to be added to a function called at module initialization.
|
* The following code needs to be added to a function called at module initialization.
|
||||||
* the second parameter is a unique counter Id.
|
* the second parameter is a unique counter Id.
|
||||||
* A good pracice is to use the upper half word as module id and lower as counter id
|
* A good pracice is to use the upper half word as module id and lower as counter id
|
||||||
* <pre>PERF_INIT_COUNTER(counterUpd, 0xA7710001);
|
* <pre>PERF_INIT_COUNTER(counterUpd, 0xA7710001);
|
||||||
* PERF_INIT_COUNTER(counterAtt, 0xA7710002);
|
* PERF_INIT_COUNTER(counterAtt, 0xA7710002);
|
||||||
* PERF_INIT_COUNTER(counterPeriod, 0xA7710003);
|
* PERF_INIT_COUNTER(counterPeriod, 0xA7710003);
|
||||||
* PERF_INIT_COUNTER(counterAccelSamples, 0xA7710004);</pre>
|
* PERF_INIT_COUNTER(counterAccelSamples, 0xA7710004);</pre>
|
||||||
*
|
*
|
||||||
* At this point you can start using the counters as in the following samples
|
* At this point you can start using the counters as in the following samples
|
||||||
*
|
*
|
||||||
* Track the time spent on a certain function:
|
* Track the time spent on a certain function:
|
||||||
* <pre>PERF_TIMED_SECTION_START(counterAtt);
|
* <pre>PERF_TIMED_SECTION_START(counterAtt);
|
||||||
* updateAttitude(&accelState, &gyros);
|
* updateAttitude(&accelState, &gyros);
|
||||||
* PERF_TIMED_SECTION_END(counterAtt);</pre>
|
* PERF_TIMED_SECTION_END(counterAtt);</pre>
|
||||||
* PERF_TIMED_SECTION_[START!STOP] marks the beginning and the end of the code to monitor
|
* PERF_TIMED_SECTION_[START!STOP] marks the beginning and the end of the code to monitor
|
||||||
*
|
*
|
||||||
* Measure the mean of the period a certain point is reached:
|
* Measure the mean of the period a certain point is reached:
|
||||||
* <pre>PERF_MEASURE_PERIOD(counterPeriod);</pre>
|
* <pre>PERF_MEASURE_PERIOD(counterPeriod);</pre>
|
||||||
* Note that the value stored in the counter is a long running mean while max and min are single point values
|
* Note that the value stored in the counter is a long running mean while max and min are single point values
|
||||||
*
|
*
|
||||||
* Track an user defined int32_t value:
|
* Track an user defined int32_t value:
|
||||||
* <pre>PERF_TRACK_VALUE(counterAccelSamples, i);</pre>
|
* <pre>PERF_TRACK_VALUE(counterAccelSamples, i);</pre>
|
||||||
* the counter is then updated with the value of i.
|
* the counter is then updated with the value of i.
|
||||||
*
|
*
|
||||||
* \par
|
* \par
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PIOS_INSTRUMENTATION_HELPER_H
|
#ifndef PIOS_INSTRUMENTATION_HELPER_H
|
||||||
#define PIOS_INSTRUMENTATION_HELPER_H
|
#define PIOS_INSTRUMENTATION_HELPER_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user