Skip to content

Commit

Permalink
Merge branch 'master' into support/jpeg_decoder_esp32c2
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Apr 19, 2023
2 parents a8839de + fac9509 commit 28790a2
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 90 deletions.
115 changes: 36 additions & 79 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,92 +6,49 @@ on:
pull_request:

jobs:
build-master:
runs-on: ubuntu-latest
strategy:
matrix:
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2"]
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@main
with:
target: ${{ matrix.idf_target }}
path: 'examples'

build-release-v5_0:
build-examples:
name: Build for ${{ matrix.idf_target }} on ${{ matrix.idf_ver }}
runs-on: ubuntu-latest
strategy:
matrix:
idf_ver: ["release-v5.0"]
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2"]
idf_ver: ["release-v4.1", "release-v4.2", "release-v4.3"]
idf_target: ["esp32", "esp32s2"]
exclude:
- idf_ver: "release-v4.1"
idf_target: esp32s2 # ESP32S2 support started with version 4.2
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@main
with:
esp_idf_version: ${{ matrix.idf_ver }}
target: ${{ matrix.idf_target }}
path: 'examples'

build-release-v4_4:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: esp-idf build
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
working-directory: examples
run: |
. ${IDF_PATH}/export.sh
idf.py build
build-examples-pedantic:
name: Build for ${{ matrix.idf_target }} on ${{ matrix.idf_ver }}
runs-on: ubuntu-latest
strategy:
matrix:
idf_ver: ["v4.4"]
idf_target: ["esp32", "esp32s2", "esp32s3"]
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@main
with:
esp_idf_version: ${{ matrix.idf_ver }}
target: ${{ matrix.idf_target }}
path: 'examples'

build-release-v4_1:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@release-v4.1
with:
path: 'examples'

build-release-v4_2:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@release-v4.2
with:
path: 'examples'

build-release-v4_3:
runs-on: ubuntu-latest
idf_ver: ["release-v4.4", "release-v5.0", "release-v5.1", "latest"]
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2"]
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@release-v4.3
with:
path: 'examples'
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: esp-idf build
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
working-directory: examples
run: |
. ${IDF_PATH}/export.sh
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
idf.py build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.vscode
**/build
**/sdkconfig
**/sdkconfig.old
**/sdkconfig.old
**/dependencies.lock
6 changes: 5 additions & 1 deletion driver/cam_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ esp_err_t cam_config(const camera_config_t *config, framesize_t frame_size, uint
ret = cam_dma_config(config);
CAM_CHECK_GOTO(ret == ESP_OK, "cam_dma_config failed", err);

cam_obj->event_queue = xQueueCreate(cam_obj->dma_half_buffer_cnt - 1, sizeof(cam_event_t));
size_t queue_size = cam_obj->dma_half_buffer_cnt - 1;
if (queue_size == 0) {
queue_size = 1;
}
cam_obj->event_queue = xQueueCreate(queue_size, sizeof(cam_event_t));
CAM_CHECK_GOTO(cam_obj->event_queue != NULL, "event_queue create failed", err);

size_t frame_buffer_queue_len = cam_obj->frame_cnt;
Expand Down
6 changes: 3 additions & 3 deletions driver/include/esp_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ esp_err_t esp_camera_init(const camera_config_t* config);
* - ESP_OK on success
* - ESP_ERR_INVALID_STATE if the driver hasn't been initialized yet
*/
esp_err_t esp_camera_deinit();
esp_err_t esp_camera_deinit(void);

/**
* @brief Obtain pointer to a frame buffer.
*
* @return pointer to the frame buffer
*/
camera_fb_t* esp_camera_fb_get();
camera_fb_t* esp_camera_fb_get(void);

/**
* @brief Return the frame buffer to be reused again.
Expand All @@ -221,7 +221,7 @@ void esp_camera_fb_return(camera_fb_t * fb);
*
* @return pointer to the sensor
*/
sensor_t * esp_camera_sensor_get();
sensor_t * esp_camera_sensor_get(void);

/**
* @brief Save camera settings to non-volatile-storage (NVS)
Expand Down
2 changes: 1 addition & 1 deletion driver/private_include/sccb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
int SCCB_Init(int pin_sda, int pin_scl);
int SCCB_Use_Port(int sccb_i2c_port);
int SCCB_Deinit(void);
uint8_t SCCB_Probe();
uint8_t SCCB_Probe(void);
uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg);
int SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data);
uint8_t SCCB_Read16(uint8_t slv_addr, uint16_t reg);
Expand Down
5 changes: 3 additions & 2 deletions driver/private_include/xclk.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once

#include "esp_system.h"
#include "esp_camera.h"

esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz);

esp_err_t camera_enable_out_clock();
esp_err_t camera_enable_out_clock(const camera_config_t *config);

void camera_disable_out_clock();
void camera_disable_out_clock(void);
4 changes: 2 additions & 2 deletions examples/main/take_picture.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static camera_config_t camera_config = {
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};

static esp_err_t init_camera()
static esp_err_t init_camera(void)
{
//initialize the camera
esp_err_t err = esp_camera_init(&camera_config);
Expand All @@ -140,7 +140,7 @@ static esp_err_t init_camera()
return ESP_OK;
}

void app_main()
void app_main(void)
{
#if ESP_CAMERA_SUPPORTED
if(ESP_OK != init_camera()) {
Expand Down
2 changes: 1 addition & 1 deletion target/xclk.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz)
return err;
}

esp_err_t camera_enable_out_clock(camera_config_t* config)
esp_err_t camera_enable_out_clock(const camera_config_t* config)
{
esp_err_t err = xclk_timer_conf(config->ledc_timer, config->xclk_freq_hz);
if (err != ESP_OK) {
Expand Down

0 comments on commit 28790a2

Please sign in to comment.