stopwatch bugfix

This commit is contained in:
Robin Müller 2020-04-09 17:56:48 +02:00
parent 640cc1ddec
commit 8a8761ea88
5 changed files with 43 additions and 30 deletions

View File

@ -13,8 +13,9 @@ typedef uint32_t address_t;
* single interface (like RMAP or I2C) * single interface (like RMAP or I2C)
* @details * @details
* To use this class, implement a communication specific child cookie which * To use this class, implement a communication specific child cookie which
* inherits Cookie. Cookie instances are created in config/ Factory.cpp by calling * inherits Cookie. Cookie instances are created in config/Factory.cpp by
* CookieIF* childCookie = new ChildCookie(...). * calling @code{.cpp} CookieIF* childCookie = new ChildCookie(...)
* @endcode .
* *
* This cookie is then passed to the child device handlers, which stores the * This cookie is then passed to the child device handlers, which stores the
* pointer and passes it to the communication interface functions. * pointer and passes it to the communication interface functions.

View File

@ -60,9 +60,9 @@ public:
* this can be performed in this function, which is called on device handler * this can be performed in this function, which is called on device handler
* initialization. * initialization.
* @param cookie * @param cookie
* @return -@c RETURN_OK if initialization was successfull * @return
* - Everything else triggers failure event with * - @c RETURN_OK if initialization was successfull
* returnvalue as parameter 1 * - Everything else triggers failure event with returnvalue as parameter 1
*/ */
virtual ReturnValue_t initializeInterface(CookieIF * cookie) = 0; virtual ReturnValue_t initializeInterface(CookieIF * cookie) = 0;
@ -73,9 +73,9 @@ public:
* @param cookie * @param cookie
* @param data * @param data
* @param len * @param len
* @return -@c RETURN_OK for successfull send * @return
* - Everything else triggers failure event with * - @c RETURN_OK for successfull send
* returnvalue as parameter 1 * - Everything else triggers failure event with returnvalue as parameter 1
*/ */
virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t * sendData, virtual ReturnValue_t sendMessage(CookieIF *cookie, const uint8_t * sendData,
size_t sendLen) = 0; size_t sendLen) = 0;
@ -84,9 +84,9 @@ public:
* Called by DHB in the GET_WRITE doGetWrite(). * Called by DHB in the GET_WRITE doGetWrite().
* Get send confirmation that the data in sendMessage() was sent successfully. * Get send confirmation that the data in sendMessage() was sent successfully.
* @param cookie * @param cookie
* @return -@c RETURN_OK if data was sent successfull * @return - @c RETURN_OK if data was sent successfull
* - Everything else triggers falure event with * - Everything else triggers falure event with
* returnvalue as parameter 1 * returnvalue as parameter 1
*/ */
virtual ReturnValue_t getSendSuccess(CookieIF *cookie) = 0; virtual ReturnValue_t getSendSuccess(CookieIF *cookie) = 0;
@ -99,9 +99,9 @@ public:
* *
* @param cookie * @param cookie
* @param requestLen Size of data to read * @param requestLen Size of data to read
* @return -@c RETURN_OK to confirm the request for data has been sent. * @return - @c RETURN_OK to confirm the request for data has been sent.
* - Everything else triggers failure event with * - Everything else triggers failure event with
* returnvalue as parameter 1 * returnvalue as parameter 1
*/ */
virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen) = 0; virtual ReturnValue_t requestReceiveMessage(CookieIF *cookie, size_t requestLen) = 0;
@ -113,8 +113,8 @@ public:
* @param buffer [out] Set reply here (by using *buffer = ...) * @param buffer [out] Set reply here (by using *buffer = ...)
* @param size [out] size pointer to set (by using *size = ...). * @param size [out] size pointer to set (by using *size = ...).
* Set to 0 if no reply was received * Set to 0 if no reply was received
* @return -@c RETURN_OK for successfull receive * @return - @c RETURN_OK for successfull receive
* -@c NO_REPLY_RECEIVED if not reply was received. Setting size to * - @c NO_REPLY_RECEIVED if not reply was received. Setting size to
* 0 has the same effect * 0 has the same effect
* - Everything else triggers failure event with * - Everything else triggers failure event with
* returnvalue as parameter 1 * returnvalue as parameter 1

View File

@ -35,24 +35,20 @@ public:
static constexpr ReturnValue_t SEMAPHORE_NOT_OWNED = MAKE_RETURN_CODE(2); static constexpr ReturnValue_t SEMAPHORE_NOT_OWNED = MAKE_RETURN_CODE(2);
static constexpr ReturnValue_t SEMAPHORE_NULLPOINTER = MAKE_RETURN_CODE(3); static constexpr ReturnValue_t SEMAPHORE_NULLPOINTER = MAKE_RETURN_CODE(3);
/**
* Create a binary semaphore
*/
BinarySemaphore(); BinarySemaphore();
/** /**
* Copy ctor * @brief Copy ctor
* @param
*/ */
BinarySemaphore(const BinarySemaphore&); BinarySemaphore(const BinarySemaphore&);
/** /**
* Copy assignment * @brief Copy assignment
*/ */
BinarySemaphore& operator=(const BinarySemaphore&); BinarySemaphore& operator=(const BinarySemaphore&);
/** /**
* Move constructor * @brief Move constructor
*/ */
BinarySemaphore (BinarySemaphore &&); BinarySemaphore (BinarySemaphore &&);
@ -81,16 +77,16 @@ public:
/** /**
* Same as lockBinarySemaphore() with timeout in FreeRTOS ticks. * Same as lockBinarySemaphore() with timeout in FreeRTOS ticks.
* @param timeoutTicks * @param timeoutTicks
* @return -@c RETURN_OK on success * @return - @c RETURN_OK on success
* -@c RETURN_FAILED on failure * - @c RETURN_FAILED on failure
*/ */
ReturnValue_t takeBinarySemaphoreTickTimeout(TickType_t timeoutTicks = ReturnValue_t takeBinarySemaphoreTickTimeout(TickType_t timeoutTicks =
BinarySemaphore::NO_BLOCK_TICKS); BinarySemaphore::NO_BLOCK_TICKS);
/** /**
* Give back the binary semaphore * Give back the binary semaphore
* @return -@c RETURN_OK on success * @return - @c RETURN_OK on success
* -@c RETURN_FAILED on failure * - @c RETURN_FAILED on failure
*/ */
ReturnValue_t giveBinarySemaphore(); ReturnValue_t giveBinarySemaphore();
@ -108,8 +104,8 @@ public:
/** /**
* Wrapper function to give back semaphore from handle * Wrapper function to give back semaphore from handle
* @param semaphore * @param semaphore
* @return -@c RETURN_OK on success * @return - @c RETURN_OK on success
* -@c RETURN_FAILED on failure * - @c RETURN_FAILED on failure
*/ */
static ReturnValue_t giveBinarySemaphore(SemaphoreHandle_t semaphore); static ReturnValue_t giveBinarySemaphore(SemaphoreHandle_t semaphore);
@ -118,8 +114,8 @@ public:
* @param semaphore * @param semaphore
* @param higherPriorityTaskWoken This will be set to pdPASS if a task with a higher priority * @param higherPriorityTaskWoken This will be set to pdPASS if a task with a higher priority
* was unblocked * was unblocked
* @return -@c RETURN_OK on success * @return - @c RETURN_OK on success
* -@c RETURN_FAILED on failure * - @c RETURN_FAILED on failure
*/ */
static ReturnValue_t giveBinarySemaphoreFromISR(SemaphoreHandle_t semaphore, static ReturnValue_t giveBinarySemaphoreFromISR(SemaphoreHandle_t semaphore,
BaseType_t * higherPriorityTaskWoken); BaseType_t * higherPriorityTaskWoken);

16
serialize/SerializeDoc.h Normal file
View File

@ -0,0 +1,16 @@
/**
* @page serialPage Serialization Tools
* This page refers to the serialization tools included in framework/serialize.
* The serialization tools are a useful tool to convert object data into raw
* buffers and vice-versa. Here is a rough overview which tool to use for
* which purpose.
*
* @section endSwapper Endian Swapper
* This header file includes tools to do simple serial order swapping
*
* @section serialiezIF SerializeIF
*
* @section serElement SerializeElement
*
*/

View File

@ -31,7 +31,7 @@ seconds_t Stopwatch::stopSeconds() {
void Stopwatch::display() { void Stopwatch::display() {
if(displayMode == StopwatchDisplayMode::MILLIS) { if(displayMode == StopwatchDisplayMode::MILLIS) {
info << "Stopwatch: Operation took " << elapsedTime.tv_sec * 1000 + info << "Stopwatch: Operation took " << elapsedTime.tv_sec / 1000 +
elapsedTime.tv_usec * 1000 << " milliseconds" << std::endl; elapsedTime.tv_usec * 1000 << " milliseconds" << std::endl;
} }
else if(displayMode == StopwatchDisplayMode::SECONDS) { else if(displayMode == StopwatchDisplayMode::SECONDS) {