Simplify ISR task wake checks
The macro checks the variable, so we don't need to check it ourselves
This commit is contained in:
parent
70f6604878
commit
636af4d33d
|
@ -561,9 +561,7 @@ void DisplayApp::PushMessage(Messages msg) {
|
||||||
if (in_isr()) {
|
if (in_isr()) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
xQueueSendFromISR(msgQueue, &msg, &xHigherPriorityTaskWoken);
|
xQueueSendFromISR(msgQueue, &msg, &xHigherPriorityTaskWoken);
|
||||||
if (xHigherPriorityTaskWoken == pdTRUE) {
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
TickType_t timeout = portMAX_DELAY;
|
TickType_t timeout = portMAX_DELAY;
|
||||||
// Make xQueueSend() non-blocking if the message is a Notification message. We do this to avoid
|
// Make xQueueSend() non-blocking if the message is a Notification message. We do this to avoid
|
||||||
|
|
|
@ -110,13 +110,9 @@ void DisplayApp::DisplayOtaProgress(uint8_t percent, uint16_t color) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayApp::PushMessage(Display::Messages msg) {
|
void DisplayApp::PushMessage(Display::Messages msg) {
|
||||||
BaseType_t xHigherPriorityTaskWoken;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
xHigherPriorityTaskWoken = pdFALSE;
|
|
||||||
xQueueSendFromISR(msgQueue, &msg, &xHigherPriorityTaskWoken);
|
xQueueSendFromISR(msgQueue, &msg, &xHigherPriorityTaskWoken);
|
||||||
if (xHigherPriorityTaskWoken) {
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
/* Actual macro used here is port specific. */
|
|
||||||
// TODO : should I do something here?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayApp::Register(Pinetime::System::SystemTask* /*systemTask*/) {
|
void DisplayApp::Register(Pinetime::System::SystemTask* /*systemTask*/) {
|
||||||
|
|
|
@ -103,10 +103,7 @@ void HeartRateTask::Work() {
|
||||||
void HeartRateTask::PushMessage(HeartRateTask::Messages msg) {
|
void HeartRateTask::PushMessage(HeartRateTask::Messages msg) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
xQueueSendFromISR(messageQueue, &msg, &xHigherPriorityTaskWoken);
|
xQueueSendFromISR(messageQueue, &msg, &xHigherPriorityTaskWoken);
|
||||||
if (xHigherPriorityTaskWoken) {
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
/* Actual macro used here is port specific. */
|
|
||||||
// TODO : should I do something here?
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeartRateTask::StartMeasurement() {
|
void HeartRateTask::StartMeasurement() {
|
||||||
|
|
|
@ -512,10 +512,7 @@ void SystemTask::PushMessage(System::Messages msg) {
|
||||||
if (in_isr()) {
|
if (in_isr()) {
|
||||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||||
xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken);
|
xQueueSendFromISR(systemTasksMsgQueue, &msg, &xHigherPriorityTaskWoken);
|
||||||
if (xHigherPriorityTaskWoken == pdTRUE) {
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
/* Actual macro used here is port specific. */
|
|
||||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
xQueueSend(systemTasksMsgQueue, &msg, portMAX_DELAY);
|
xQueueSend(systemTasksMsgQueue, &msg, portMAX_DELAY);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user