Fix homekit compile with IDF4 (#189)

* Fix compile error for IDF -> missing include file
This commit is contained in:
Jason2866 2021-06-03 19:42:40 +02:00 committed by GitHub
parent 47e29f962e
commit aa05503645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -21,7 +21,14 @@
*
*/
//#include "soc/hwcrypto_periph.h"
#if __has_include("esp_idf_version.h")
#include "esp_idf_version.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
#warning("IDF is 4 or later")
#include "soc/hwcrypto_periph.h"
#endif
#endif
#include "soc/hwcrypto_reg.h"
#include "driver/periph_ctrl.h"
#include <mbedtls/bignum.h>

View File

@ -20,6 +20,14 @@
* limitations under the License.
*
*/
#if __has_include("esp_idf_version.h")
#include "esp_idf_version.h"
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
#warning("IDF is 4 or later")
#include "soc/hwcrypto_periph.h"
#endif
#endif
#include <stdio.h>
#include <string.h>
#include <malloc.h>
@ -27,7 +35,6 @@
#include <assert.h>
#include <stdlib.h>
#include <sys/param.h>
//#include "soc/hwcrypto_periph.h"
#include "esp_system.h"
#include "esp_log.h"
#include "esp_attr.h"