Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/LEDManager/LEDManager/LEDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void LEDManager::setup()
gpio_set_direction(blink_led_pin, GPIO_MODE_OUTPUT);
this->toggleLED(LED_OFF);

#ifdef CONFIG_LED_EXTERNAL_CONTROL
#ifdef CONFIG_LED_CONTROL_MODE_PWM
ESP_LOGI(LED_MANAGER_TAG, "Setting up illuminator led.");
const int freq = CONFIG_LED_EXTERNAL_PWM_FREQ;
const auto resolution = LEDC_TIMER_8_BIT;
Expand Down Expand Up @@ -180,7 +180,7 @@ void LEDManager::toggleLED(const bool state) const

void LEDManager::setExternalLEDDutyCycle(uint8_t dutyPercent)
{
#ifdef CONFIG_LED_EXTERNAL_CONTROL
#ifdef CONFIG_LED_CONTROL_MODE_PWM
const uint32_t dutyCycle = (static_cast<uint32_t>(dutyPercent) * 255) / 100;
ESP_LOGI(LED_MANAGER_TAG, "Updating external LED duty to %u%% (raw %lu)", dutyPercent, dutyCycle);

Expand All @@ -190,7 +190,7 @@ void LEDManager::setExternalLEDDutyCycle(uint8_t dutyPercent)
ESP_ERROR_CHECK_WITHOUT_ABORT(ledc_update_duty(LEDC_LOW_SPEED_MODE, LEDC_CHANNEL_0));
#else
(void)dutyPercent; // unused
ESP_LOGW(LED_MANAGER_TAG, "CONFIG_LED_EXTERNAL_CONTROL not enabled; ignoring duty update");
ESP_LOGW(LED_MANAGER_TAG, "CONFIG_LED_CONTROL_MODE_PWM not enabled; ignoring duty update");
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion components/LEDManager/LEDManager/LEDManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

#ifdef CONFIG_LED_EXTERNAL_CONTROL
#ifdef CONFIG_LED_CONTROL_MODE_PWM
#include "driver/ledc.h"
#endif

Expand Down
31 changes: 31 additions & 0 deletions components/esp32-camera/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build examples
on:
push:
branches:
- master
pull_request:

jobs:
build-examples:
name: Build for ${{ matrix.idf_target }} on ${{ matrix.idf_ver }}
runs-on: ubuntu-latest
strategy:
matrix:
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"]
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3"]
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: esp-idf build
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
working-directory: examples/camera_example
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
27 changes: 27 additions & 0 deletions components/esp32-camera/.github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '20 9 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue appears to be stale. Please close it if its no longer valid.'
stale-pr-message: 'This pull request appears to be stale. Please close it if its no longer valid.'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
19 changes: 19 additions & 0 deletions components/esp32-camera/.github/workflows/upload_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Push component to https://components.espressif.com
on:
push:
tags:
- v*
jobs:
upload_components:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
submodules: "recursive"
- name: Upload component to the component registry
uses: espressif/upload-components-ci-action@v1
with:
name: "esp32-camera"
namespace: "espressif"
version: ${{ github.ref_name }}
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
7 changes: 7 additions & 0 deletions components/esp32-camera/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*.DS_Store
.vscode
**/build
**/sdkconfig
**/sdkconfig.old
**/dependencies.lock
**/managed_components/**
106 changes: 106 additions & 0 deletions components/esp32-camera/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# get IDF version for comparison
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")

# set conversion sources
set(srcs
conversions/yuv.c
conversions/to_jpg.cpp
conversions/to_bmp.c
conversions/jpge.cpp
)

set(priv_include_dirs
conversions/private_include
)

set(include_dirs
driver/include
conversions/include
)

set(COMPONENT_REQUIRES driver)

# set driver sources only for supported platforms
if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3")
list(APPEND srcs
driver/esp_camera.c
driver/cam_hal.c
driver/sensor.c
sensors/ov2640.c
sensors/ov3660.c
sensors/ov5640.c
sensors/ov7725.c
sensors/ov7670.c
sensors/nt99141.c
sensors/gc0308.c
sensors/gc2145.c
sensors/gc032a.c
sensors/bf3005.c
sensors/bf20a6.c
sensors/sc101iot.c
sensors/sc030iot.c
sensors/sc031gs.c
sensors/mega_ccm.c
sensors/hm1055.c
sensors/hm0360.c
)

list(APPEND priv_include_dirs
driver/private_include
sensors/private_include
target/private_include
)

if(IDF_TARGET STREQUAL "esp32")
list(APPEND srcs
target/xclk.c
target/esp32/ll_cam.c
)
endif()

if(IDF_TARGET STREQUAL "esp32s2")
list(APPEND srcs
target/xclk.c
target/esp32s2/ll_cam.c
)

list(APPEND priv_include_dirs
target/esp32s2/private_include
)
endif()

if(IDF_TARGET STREQUAL "esp32s3")
list(APPEND srcs
target/esp32s3/ll_cam.c
)
endif()

set(priv_requires freertos nvs_flash esp_mm)

set(min_version_for_esp_timer "4.2")
if (idf_version VERSION_GREATER_EQUAL min_version_for_esp_timer)
list(APPEND priv_requires esp_timer)
endif()

# include the SCCB I2C driver
# this uses either the legacy I2C API or the newer version from IDF v5.4
# as this features a method to obtain the I2C driver from a port number
if (idf_version VERSION_GREATER_EQUAL "5.4" AND NOT CONFIG_SCCB_HARDWARE_I2C_DRIVER_LEGACY)
list(APPEND srcs driver/sccb-ng.c)
else()
list(APPEND srcs driver/sccb.c)
endif()

if (idf_version VERSION_GREATER_EQUAL "6.0")
list(APPEND priv_requires esp_driver_gpio)
endif()

endif()

idf_component_register(
SRCS ${srcs}
INCLUDE_DIRS ${include_dirs}
PRIV_INCLUDE_DIRS ${priv_include_dirs}
REQUIRES driver # due to include of driver/gpio.h in esp_camera.h
PRIV_REQUIRES ${priv_requires}
)
Loading