TypedQueue: make functions return bools instead of BaseType_t

Minor cleanup to hide away some FreeRTOS bits.

Note: I believe src/CustomRF95.cpp:62 had a bug where it had the
condition inverted.
This commit is contained in:
Girts Folkmanis
2020-03-15 17:52:01 -07:00
parent 90ecdf229e
commit 7a4a1af332
5 changed files with 23 additions and 24 deletions

View File

@@ -66,16 +66,14 @@ public:
/// Return a buffer for use by others
void release(T *p)
{
int res = dead.enqueue(p, 0);
assert(res == pdTRUE);
assert(dead.enqueue(p, 0));
assert(p >= buf && (p - buf) < maxElements); // sanity check to make sure a programmer didn't free something that didn't come from this pool
}
/// Return a buffer from an ISR, if higherPriWoken is set to true you have some work to do ;-)
void releaseFromISR(T *p, BaseType_t *higherPriWoken)
{
int res = dead.enqueueFromISR(p, higherPriWoken);
assert(res == pdTRUE);
assert(dead.enqueueFromISR(p, higherPriWoken));
assert(p >= buf && (p - buf) < maxElements); // sanity check to make sure a programmer didn't free something that didn't come from this pool
}
};