Remove unnecessary ternary operator
This commit is contained in:
parent
287801811f
commit
0c9e08af05
2 changed files with 4 additions and 4 deletions
|
@ -14,11 +14,11 @@ auto freertos::BinarySemaphore::operator=(
|
||||||
}
|
}
|
||||||
auto freertos::BinarySemaphore::take(TickType_t timeout) -> bool {
|
auto freertos::BinarySemaphore::take(TickType_t timeout) -> bool {
|
||||||
BaseType_t success = xSemaphoreTake(handle, timeout);
|
BaseType_t success = xSemaphoreTake(handle, timeout);
|
||||||
return success == pdTRUE ? true : false;
|
return success == pdTRUE;
|
||||||
}
|
}
|
||||||
auto freertos::BinarySemaphore::give() -> bool {
|
auto freertos::BinarySemaphore::give() -> bool {
|
||||||
BaseType_t success = xSemaphoreGive(handle);
|
BaseType_t success = xSemaphoreGive(handle);
|
||||||
return success == pdTRUE ? true : false;
|
return success == pdTRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto freertos::BinarySemaphore::getCount() -> size_t {
|
auto freertos::BinarySemaphore::getCount() -> size_t {
|
||||||
|
|
|
@ -12,9 +12,9 @@ auto freertos::Mutex::operator=(const Mutex &&other) noexcept -> Mutex & {
|
||||||
}
|
}
|
||||||
auto freertos::Mutex::lock(TickType_t timeout) -> bool{
|
auto freertos::Mutex::lock(TickType_t timeout) -> bool{
|
||||||
BaseType_t success = xSemaphoreTake(handle, timeout);
|
BaseType_t success = xSemaphoreTake(handle, timeout);
|
||||||
return success == pdTRUE ? true : false;
|
return success == pdTRUE;
|
||||||
}
|
}
|
||||||
auto freertos::Mutex::unlock() -> bool {
|
auto freertos::Mutex::unlock() -> bool {
|
||||||
BaseType_t success = xSemaphoreGive(handle);
|
BaseType_t success = xSemaphoreGive(handle);
|
||||||
return success == pdTRUE ? true : false;
|
return success == pdTRUE;
|
||||||
}
|
}
|
Loading…
Reference in a new issue