improved const correctness
This commit is contained in:
parent
c4e60946d3
commit
95bf5c1071
@ -63,7 +63,7 @@ TaskHandle_t BinarySemaphoreUsingTask::getTaskHandle() {
|
|||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t BinarySemaphoreUsingTask::getSemaphoreCounter() {
|
uint8_t BinarySemaphoreUsingTask::getSemaphoreCounter() const {
|
||||||
uint32_t notificationValue;
|
uint32_t notificationValue;
|
||||||
xTaskNotifyAndQuery(handle, 0, eNoAction, ¬ificationValue);
|
xTaskNotifyAndQuery(handle, 0, eNoAction, ¬ificationValue);
|
||||||
return notificationValue;
|
return notificationValue;
|
||||||
|
@ -26,7 +26,7 @@ public:
|
|||||||
ReturnValue_t acquire(uint32_t timeoutMs =
|
ReturnValue_t acquire(uint32_t timeoutMs =
|
||||||
SemaphoreIF::NO_TIMEOUT) override;
|
SemaphoreIF::NO_TIMEOUT) override;
|
||||||
ReturnValue_t release() override;
|
ReturnValue_t release() override;
|
||||||
uint8_t getSemaphoreCounter() override;
|
uint8_t getSemaphoreCounter() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take the binary semaphore.
|
* Take the binary semaphore.
|
||||||
|
@ -82,7 +82,7 @@ ReturnValue_t BinarySemaphore::release() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t BinarySemaphore::getSemaphoreCounter() {
|
uint8_t BinarySemaphore::getSemaphoreCounter() const {
|
||||||
return uxSemaphoreGetCount(handle);
|
return uxSemaphoreGetCount(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
//! @brief Destructor
|
//! @brief Destructor
|
||||||
virtual ~BinarySemaphore();
|
virtual ~BinarySemaphore();
|
||||||
|
|
||||||
uint8_t getSemaphoreCounter() override;
|
uint8_t getSemaphoreCounter() const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take the binary semaphore.
|
* Take the binary semaphore.
|
||||||
|
@ -16,8 +16,7 @@ CountingSemaphoreUsingTask::CountingSemaphoreUsingTask(uint8_t maxCount,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CountingSemaphoreUsingTask::acquire(
|
ReturnValue_t CountingSemaphoreUsingTask::acquire(uint32_t timeoutMs) {
|
||||||
uint32_t timeoutMs) {
|
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,6 +24,6 @@ ReturnValue_t CountingSemaphoreUsingTask::release() {
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t CountingSemaphoreUsingTask::getSemaphoreCounter() {
|
uint8_t CountingSemaphoreUsingTask::getSemaphoreCounter() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public:
|
|||||||
|
|
||||||
ReturnValue_t acquire(uint32_t timeoutMs) override;
|
ReturnValue_t acquire(uint32_t timeoutMs) override;
|
||||||
ReturnValue_t release() override;
|
ReturnValue_t release() override;
|
||||||
uint8_t getSemaphoreCounter() override;
|
uint8_t getSemaphoreCounter() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TaskHandle_t handle;
|
TaskHandle_t handle;
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
* is returned if the semaphore is available, and 0 is returned if the
|
* is returned if the semaphore is available, and 0 is returned if the
|
||||||
* semaphore is not available.
|
* semaphore is not available.
|
||||||
*/
|
*/
|
||||||
virtual uint8_t getSemaphoreCounter() = 0;
|
virtual uint8_t getSemaphoreCounter() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FRAMEWORK_TASKS_SEMAPHOREIF_H_ */
|
#endif /* FRAMEWORK_TASKS_SEMAPHOREIF_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user