diff --git a/README.md b/README.md index 3dba74d..659759e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ ## Dependencies 1. [zh_avr_free_rtos](http://git.zh.com.ru/avr_libraries/zh_avr_free_rtos) +2. [zh_avr_common](http://git.zh.com.ru/avr_libraries/zh_avr_common) ## Using @@ -17,6 +18,7 @@ In an existing project, run the following command to install the component: cd ../your_project/lib git clone http://git.zh.com.ru/avr_libraries/zh_avr_free_rtos git clone http://git.zh.com.ru/avr_libraries/zh_avr_vector +git clone http://git.zh.com.ru/avr_libraries/zh_avr_common ``` In the application, add the component: diff --git a/include/zh_avr_vector.h b/include/zh_avr_vector.h index e04a740..28d2d48 100755 --- a/include/zh_avr_vector.h +++ b/include/zh_avr_vector.h @@ -6,30 +6,13 @@ #include "stdint.h" #include "string.h" #include "stdbool.h" +#include "avr_err.h" #ifdef __cplusplus extern "C" { #endif - typedef enum - { - AVR_FAIL = -1, - AVR_OK, - AVR_ERR_NO_MEM, - AVR_ERR_INVALID_ARG, - AVR_ERR_INVALID_STATE, - AVR_ERR_INVALID_SIZE, - AVR_ERR_NOT_FOUND, - AVR_ERR_NOT_SUPPORTED, - AVR_ERR_TIMEOUT, - AVR_ERR_INVALID_RESPONSE, - AVR_ERR_INVALID_CRC, - AVR_ERR_INVALID_VERSION, - AVR_ERR_NOT_FINISHED, - AVR_ERR_NOT_ALLOWED - } avr_err_t; - typedef struct // Main structure of vector data. { void **items; // Array of pointers of vector items. diff --git a/version.txt b/version.txt index 359a5b9..50aea0e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2.0.0 \ No newline at end of file +2.1.0 \ No newline at end of file diff --git a/zh_avr_vector.c b/zh_avr_vector.c index e0959c8..edbe4f1 100755 --- a/zh_avr_vector.c +++ b/zh_avr_vector.c @@ -1,11 +1,5 @@ #include "zh_avr_vector.h" -#define ZH_ERROR_CHECK(cond, err, ...) \ - if (!(cond)) \ - { \ - return err; \ - } - static avr_err_t _resize(zh_avr_vector_t *vector, uint8_t capacity); avr_err_t zh_avr_vector_init(zh_avr_vector_t *vector, uint8_t unit)