From dfebb15213e1c74e54b7bb142cc9d0e706511269 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Thu, 14 Aug 2025 11:54:45 +0300 Subject: [PATCH] perf: updated isr handler --- include/zh_avr_pcf8574.h | 2 +- version.txt | 2 +- zh_avr_pcf8574.c | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/zh_avr_pcf8574.h b/include/zh_avr_pcf8574.h index b8f7bfe..beab623 100644 --- a/include/zh_avr_pcf8574.h +++ b/include/zh_avr_pcf8574.h @@ -133,7 +133,7 @@ extern "C" /** * @brief PCF8574 ISR handler. */ - void zh_avr_pcf8574_isr_handler(void); + BaseType_t zh_avr_pcf8574_isr_handler(void); #ifdef __cplusplus } diff --git a/version.txt b/version.txt index afaf360..1cc5f65 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.1.0 \ No newline at end of file diff --git a/zh_avr_pcf8574.c b/zh_avr_pcf8574.c index 408e409..8b9e830 100644 --- a/zh_avr_pcf8574.c +++ b/zh_avr_pcf8574.c @@ -129,17 +129,14 @@ static avr_err_t _zh_avr_pcf8574_configure_interrupts(const zh_avr_pcf8574_init_ return AVR_OK; } -void zh_avr_pcf8574_isr_handler(void) +BaseType_t zh_avr_pcf8574_isr_handler(void) { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; if ((PIND & (1 << _interrupt_gpio)) == 0) { - BaseType_t xHigherPriorityTaskWoken = pdFALSE; xSemaphoreGiveFromISR(_interrupt_semaphore, &xHigherPriorityTaskWoken); - if (xHigherPriorityTaskWoken == pdTRUE) - { - portYIELD(); - }; } + return xHigherPriorityTaskWoken; } static void _zh_avr_pcf8574_isr_processing_task(void *pvParameter)