Add support for IDF 4.X
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "driver/rtc_io.h"
|
||||
#include "driver/periph_ctrl.h"
|
||||
#include "esp_intr_alloc.h"
|
||||
#include "esp_system.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "nvs.h"
|
||||
#include "sensor.h"
|
||||
@@ -1374,8 +1375,11 @@ sensor_t * esp_camera_sensor_get()
|
||||
|
||||
esp_err_t esp_camera_save_to_nvs(const char *key)
|
||||
{
|
||||
#ifdef ESP_IDF_VERSION_MAJOR
|
||||
nvs_handle_t handle;
|
||||
#else
|
||||
nvs_handle handle;
|
||||
|
||||
#endif
|
||||
esp_err_t ret = nvs_open(key,NVS_READWRITE,&handle);
|
||||
|
||||
if (ret == ESP_OK) {
|
||||
@@ -1399,7 +1403,11 @@ esp_err_t esp_camera_save_to_nvs(const char *key)
|
||||
|
||||
esp_err_t esp_camera_load_from_nvs(const char *key)
|
||||
{
|
||||
nvs_handle handle;
|
||||
#ifdef ESP_IDF_VERSION_MAJOR
|
||||
nvs_handle_t handle;
|
||||
#else
|
||||
nvs_handle handle;
|
||||
#endif
|
||||
uint8_t pf;
|
||||
|
||||
esp_err_t ret = nvs_open(key,NVS_READWRITE,&handle);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "driver/ledc.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_system.h"
|
||||
#include "xclk.h"
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
|
||||
@@ -20,7 +21,9 @@ esp_err_t camera_enable_out_clock(camera_config_t* config)
|
||||
timer_conf.freq_hz = config->xclk_freq_hz;
|
||||
timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE;
|
||||
timer_conf.timer_num = config->ledc_timer;
|
||||
//timer_conf.clk_cfg = LEDC_AUTO_CLK; //todo: IDF 4.X support
|
||||
#ifdef ESP_IDF_VERSION_MAJOR
|
||||
timer_conf.clk_cfg = LEDC_AUTO_CLK;
|
||||
#endif
|
||||
esp_err_t err = ledc_timer_config(&timer_conf);
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err);
|
||||
|
||||
Reference in New Issue
Block a user