From 196398ac6fe9026384036924bc1d26f0e22583b7 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sun, 17 Aug 2025 08:45:52 +0300 Subject: [PATCH] feat: updated supported interrupt pins --- .gitignore | 1 + README.md | 2 +- version.txt | 2 +- zh_avr_pcf8574.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/README.md b/README.md index e88640e..1325620 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## Note 1. Enable interrupt support only if input GPIO's are used. -2. All the INT GPIO's on the extenders must be connected to the one GPIO on AVR. Only PORTD4 - PORTD7 are acceptable! +2. All the INT GPIO's on the extenders must be connected to the one GPIO on AVR. Only PORTD0 - PORTD7 are acceptable! 3. The input GPIO's are always pullup to the power supply. ## Dependencies diff --git a/version.txt b/version.txt index 1cc5f65..867e524 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.2.0 \ No newline at end of file diff --git a/zh_avr_pcf8574.c b/zh_avr_pcf8574.c index 8b9e830..9ff3f82 100644 --- a/zh_avr_pcf8574.c +++ b/zh_avr_pcf8574.c @@ -81,7 +81,7 @@ static avr_err_t _zh_avr_pcf8574_validate_config(const zh_avr_pcf8574_init_confi ZH_ERROR_CHECK(config != NULL, AVR_ERR_INVALID_ARG); ZH_ERROR_CHECK((config->i2c_address >= 0x20 && config->i2c_address <= 0x27) || (config->i2c_address >= 0x38 && config->i2c_address <= 0x3F), AVR_ERR_INVALID_ARG); ZH_ERROR_CHECK(config->task_priority > tskIDLE_PRIORITY && config->stack_size >= 124, AVR_ERR_INVALID_ARG); - ZH_ERROR_CHECK(config->interrupt_gpio == 0xFF || config->interrupt_gpio == PORTD4 || config->interrupt_gpio == PORTD5 || config->interrupt_gpio == PORTD6 || config->interrupt_gpio == PORTD7, AVR_ERR_INVALID_ARG); + ZH_ERROR_CHECK(config->interrupt_gpio == 0xFF || (config->interrupt_gpio >= PORTD0 && config->interrupt_gpio <= PORTD7), AVR_ERR_INVALID_ARG); return AVR_OK; }