Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(esp32p4): Add initial ESP32-P4 support #10358

Merged
merged 28 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcd64f7
feat(esp32p4): Initial changes required for ESP32-P4
Jason2866 Aug 20, 2024
a1c1ccb
fix(esp32p4): Fix lib builder errors
lucasssvaz Sep 19, 2024
ea83f5a
change(esp32p4): Unhide board
lucasssvaz Sep 19, 2024
bcc55ea
ci(esp32p4): Add ESP32-P4 to workflow
lucasssvaz Sep 19, 2024
394dd1b
change(esptool): Update esptool to 4.8.0
lucasssvaz Sep 19, 2024
03d6e32
fix(build): Fix redefinition errors
lucasssvaz Sep 19, 2024
5c22a28
fix(build): Remove old commands
lucasssvaz Sep 19, 2024
0a37668
change(esptool): Remove unsupported 32-bit tools
lucasssvaz Sep 19, 2024
979b16b
fix(get.py): Force exe generation
lucasssvaz Sep 19, 2024
26218d4
Revert "fix(get.py): Force exe generation"
lucasssvaz Sep 19, 2024
b23a2fb
fix(get.py): Fix system check
lucasssvaz Sep 19, 2024
488740b
change(tools): Push generated binaries to PR
github-actions[bot] Sep 19, 2024
72643fa
ci(esp32p4): Add missing ESP32-P4 entries
lucasssvaz Sep 19, 2024
e6cf7dc
fix(esp32p4): Add chip info
lucasssvaz Sep 20, 2024
62fef78
fix(esp32p4): Fix build commands
lucasssvaz Sep 20, 2024
149edfa
docs(esp32p4): Add missing references to P4
lucasssvaz Sep 20, 2024
e372320
fix(esp32p4): Fix clock sources definitions
lucasssvaz Sep 21, 2024
a8e1fdf
fix(esp32p4): Set CPU frequency to 360 MHz so it is stable in all chips
lucasssvaz Sep 21, 2024
fb3443d
refactor(esp32p4): Change preprocessor conditionals for maintainability
lucasssvaz Sep 21, 2024
f72fc69
fix(esp32p4): Add missing menu options
lucasssvaz Sep 22, 2024
f1b126c
fix(esp32p4): Mark as not in development json in readme
lucasssvaz Sep 24, 2024
b4f535a
fix(esp32p4): Add P4 to ci.json files
lucasssvaz Sep 24, 2024
24efbdd
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
09c0883
fix(get.py): Remove unused include
lucasssvaz Sep 24, 2024
50befb5
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
5913778
change(tools): Push generated binaries to PR
github-actions[bot] Sep 24, 2024
c882a84
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Sep 24, 2024
148b633
fix(ci.json): Fix formatting
lucasssvaz Sep 24, 2024
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
1 change: 1 addition & 0 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if [ "$BUILD_PIO" -eq 0 ]; then
fi

#build sketches for different targets
build "esp32p4" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32s3" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32s2" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
build "esp32c3" "$CHUNK_INDEX" "$CHUNKS_CNT" "$BUILD_LOG" "$SKETCHES_FILE" "$SKETCHES_ESP32"
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/sketch_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
esp32c3_opts="PartitionScheme=huge_app,FlashMode=dio"
esp32c6_opts="PartitionScheme=huge_app,FlashMode=dio"
esp32h2_opts="PartitionScheme=huge_app,FlashMode=dio"
esp32p4_opts="PartitionScheme=huge_app,FlashMode=dio"

# Select the common part of the FQBN based on the target. The rest will be
# appended depending on the passed options.
Expand All @@ -112,6 +113,9 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
"esp32h2")
fqbn="espressif:esp32:esp32h2:${options:-$esp32h2_opts}"
;;
"esp32p4")
fqbn="espressif:esp32:esp32p4:${options:-$esp32p4_opts}"
;;
esac

# Make it look like a JSON array.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
- esp32s3
- esp32c6
- esp32h2
- esp32p4

include:
- target: esp32
Expand All @@ -56,6 +57,8 @@ jobs:
fqbn: espressif:esp32:esp32c6
- target: esp32h2
fqbn: espressif:esp32:esp32h2
- target: esp32p4
fqbn: espressif:esp32:esp32p4


steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
# for details.
idf_ver: ["release-v5.3"]
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6", "esp32h2"]
idf_target: ["esp32", "esp32s2", "esp32s3", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32p4"]
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Check out arduino-esp32 as a component
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
strategy:
matrix:
type: ${{ fromJson(needs.gen-matrix.outputs.build-types) }}
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
with:
type: ${{ matrix.type }}
chip: ${{ matrix.chip }}
Expand All @@ -105,7 +105,7 @@ jobs:
fail-fast: false
matrix:
type: ${{ fromJson(needs.gen-matrix.outputs.hw-types) }}
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
with:
type: ${{ matrix.type }}
chip: ${{ matrix.chip }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_wokwi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
fail-fast: false
matrix:
type: ['validation']
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2']
chip: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4']
steps:
- name: Report pending
uses: actions/github-script@v7
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Here are the ESP32 series supported by the Arduino-ESP32 project:
| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) |
| ESP32-C6 | Yes | Yes | [ESP32-C6](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) |
| ESP32-H2 | Yes | Yes | [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) |
| ESP32-P4 | No | No | [ESP32-P4](https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf) |

> [!NOTE]
> ESP32-C2 is also supported by Arduino-ESP32 but requires rebuilding the static libraries. This is not trivial and requires a good understanding of the ESP-IDF
Expand Down
91 changes: 88 additions & 3 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ esp32c2.menu.EraseFlash.all.upload.erase_cmd=-e
##############################################################

esp32p4.name=ESP32P4 Dev Module
esp32p4.hide=true

esp32p4.bootloader.tool=esptool_py
esp32p4.bootloader.tool.default=esptool_py
Expand All @@ -188,10 +187,10 @@ esp32p4.build.mcu=esp32p4
esp32p4.build.core=esp32
esp32p4.build.variant=esp32p4
esp32p4.build.board=ESP32P4_DEV
esp32p4.build.bootloader_addr=0x0
esp32p4.build.bootloader_addr=0x2000

esp32p4.build.cdc_on_boot=0
esp32p4.build.f_cpu=400000000L
esp32p4.build.f_cpu=360000000L
esp32p4.build.flash_size=4MB
esp32p4.build.flash_freq=80m
esp32p4.build.img_freq=80m
Expand All @@ -203,6 +202,25 @@ esp32p4.build.defines=
## IDE 2.0 Seems to not update the value
esp32p4.menu.JTAGAdapter.default=Disabled
esp32p4.menu.JTAGAdapter.default.build.copy_jtag_files=0
esp32p4.menu.JTAGAdapter.builtin=Integrated USB JTAG
esp32p4.menu.JTAGAdapter.builtin.build.openocdscript=esp32p4-builtin.cfg
esp32p4.menu.JTAGAdapter.builtin.build.copy_jtag_files=1
esp32p4.menu.JTAGAdapter.external=FTDI Adapter
esp32p4.menu.JTAGAdapter.external.build.openocdscript=esp32p4-ftdi.cfg
esp32p4.menu.JTAGAdapter.external.build.copy_jtag_files=1
esp32p4.menu.JTAGAdapter.bridge=ESP USB Bridge
esp32p4.menu.JTAGAdapter.bridge.build.openocdscript=esp32p4-bridge.cfg
esp32p4.menu.JTAGAdapter.bridge.build.copy_jtag_files=1

esp32p4.menu.CDCOnBoot.default=Disabled
esp32p4.menu.CDCOnBoot.default.build.cdc_on_boot=0
esp32p4.menu.CDCOnBoot.cdc=Enabled
esp32p4.menu.CDCOnBoot.cdc.build.cdc_on_boot=1

esp32p4.menu.PSRAM.disabled=Disabled
esp32p4.menu.PSRAM.disabled.build.defines=
esp32p4.menu.PSRAM.enabled=Enabled
esp32p4.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM

esp32p4.menu.CDCOnBoot.default=Disabled
esp32p4.menu.CDCOnBoot.default.build.cdc_on_boot=0
Expand All @@ -211,20 +229,87 @@ esp32p4.menu.CDCOnBoot.cdc.build.cdc_on_boot=1

esp32p4.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
esp32p4.menu.PartitionScheme.default.build.partitions=default
esp32p4.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
esp32p4.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
esp32p4.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS)
esp32p4.menu.PartitionScheme.default_8MB.build.partitions=default_8MB
esp32p4.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336
esp32p4.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
esp32p4.menu.PartitionScheme.minimal.build.partitions=minimal
esp32p4.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2)
esp32p4.menu.PartitionScheme.no_fs.build.partitions=no_fs
esp32p4.menu.PartitionScheme.no_fs.upload.maximum_size=2031616
esp32p4.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
esp32p4.menu.PartitionScheme.no_ota.build.partitions=no_ota
esp32p4.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
esp32p4.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
esp32p4.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
esp32p4.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
esp32p4.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
esp32p4.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
esp32p4.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
esp32p4.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
esp32p4.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
esp32p4.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
esp32p4.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
esp32p4.menu.PartitionScheme.huge_app.build.partitions=huge_app
esp32p4.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
esp32p4.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
esp32p4.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
esp32p4.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
esp32p4.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FATFS)
esp32p4.menu.PartitionScheme.fatflash.build.partitions=ffat
esp32p4.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
esp32p4.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9.9MB FATFS)
esp32p4.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB
esp32p4.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
esp32p4.menu.PartitionScheme.custom=Custom
esp32p4.menu.PartitionScheme.custom.build.partitions=
esp32p4.menu.PartitionScheme.custom.upload.maximum_size=16777216

## From https://docs.espressif.com/projects/esp-idf/en/latest/esp32p4/api-reference/kconfig.html#config-esp-default-cpu-freq-mhz
esp32p4.menu.CPUFreq.360=360MHz
esp32p4.menu.CPUFreq.360.build.f_cpu=360000000L
esp32p4.menu.CPUFreq.40=40MHz
esp32p4.menu.CPUFreq.40.build.f_cpu=40000000L

esp32p4.menu.FlashMode.qio=QIO
esp32p4.menu.FlashMode.qio.build.flash_mode=dio
esp32p4.menu.FlashMode.qio.build.boot=qio
esp32p4.menu.FlashMode.dio=DIO
esp32p4.menu.FlashMode.dio.build.flash_mode=dio
esp32p4.menu.FlashMode.dio.build.boot=dio

esp32p4.menu.FlashFreq.80=80MHz
esp32p4.menu.FlashFreq.80.build.flash_freq=80m
esp32p4.menu.FlashFreq.40=40MHz
esp32p4.menu.FlashFreq.40.build.flash_freq=40m

esp32p4.menu.FlashSize.4M=4MB (32Mb)
esp32p4.menu.FlashSize.4M.build.flash_size=4MB
esp32p4.menu.FlashSize.8M=8MB (64Mb)
esp32p4.menu.FlashSize.8M.build.flash_size=8MB
esp32p4.menu.FlashSize.8M.build.partitions=default_8MB
esp32p4.menu.FlashSize.2M=2MB (16Mb)
esp32p4.menu.FlashSize.2M.build.flash_size=2MB
esp32p4.menu.FlashSize.2M.build.partitions=minimal
esp32p4.menu.FlashSize.16M=16MB (128Mb)
esp32p4.menu.FlashSize.16M.build.flash_size=16MB

esp32p4.menu.UploadSpeed.921600=921600
esp32p4.menu.UploadSpeed.921600.upload.speed=921600
esp32p4.menu.UploadSpeed.115200=115200
esp32p4.menu.UploadSpeed.115200.upload.speed=115200
esp32p4.menu.UploadSpeed.256000.windows=256000
esp32p4.menu.UploadSpeed.256000.upload.speed=256000
esp32p4.menu.UploadSpeed.230400.windows.upload.speed=256000
esp32p4.menu.UploadSpeed.230400=230400
esp32p4.menu.UploadSpeed.230400.upload.speed=230400
esp32p4.menu.UploadSpeed.460800.linux=460800
esp32p4.menu.UploadSpeed.460800.macosx=460800
esp32p4.menu.UploadSpeed.460800.upload.speed=460800
esp32p4.menu.UploadSpeed.512000.windows=512000
esp32p4.menu.UploadSpeed.512000.upload.speed=512000

esp32p4.menu.DebugLevel.none=None
esp32p4.menu.DebugLevel.none.build.code_debug=0
Expand Down
6 changes: 6 additions & 0 deletions cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ extern "C" {
#elif CONFIG_IDF_TARGET_ESP32H2
#include "esp32h2/rom/spi_flash.h"
#define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32h2 is located at 0x0000
#elif CONFIG_IDF_TARGET_ESP32P4
#include "esp32p4/rom/spi_flash.h"
#define ESP_FLASH_IMAGE_BASE 0x2000 // Esp32p4 is located at 0x2000
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
Expand Down Expand Up @@ -335,6 +338,8 @@ uint32_t EspClass::getFlashChipSpeed(void) {
return magicFlashChipSpeed(fhdr.spi_speed);
}

// FIXME for P4
#if !defined(CONFIG_IDF_TARGET_ESP32P4)
FlashMode_t EspClass::getFlashChipMode(void) {
#if CONFIG_IDF_TARGET_ESP32S2
uint32_t spi_ctrl = REG_READ(PERIPHS_SPI_FLASH_CTRL);
Expand All @@ -361,6 +366,7 @@ FlashMode_t EspClass::getFlashChipMode(void) {
}
return (FM_DOUT);
}
#endif // if !defined(CONFIG_IDF_TARGET_ESP32P4)

uint32_t EspClass::magicFlashChipSize(uint8_t byte) {
/*
Expand Down
12 changes: 12 additions & 0 deletions cores/esp32/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ typedef enum {
#define SOC_RX0 (gpio_num_t)17
#elif CONFIG_IDF_TARGET_ESP32H2
#define SOC_RX0 (gpio_num_t)23
#elif CONFIG_IDF_TARGET_ESP32P4
#define SOC_RX0 (gpio_num_t)38
#endif
#endif

Expand All @@ -141,6 +143,8 @@ typedef enum {
#define SOC_TX0 (gpio_num_t)16
#elif CONFIG_IDF_TARGET_ESP32H2
#define SOC_TX0 (gpio_num_t)24
#elif CONFIG_IDF_TARGET_ESP32P4
#define SOC_TX0 (gpio_num_t)37
#endif
#endif

Expand All @@ -162,6 +166,8 @@ typedef enum {
#define RX1 (gpio_num_t)4
#elif CONFIG_IDF_TARGET_ESP32H2
#define RX1 (gpio_num_t)0
#elif CONFIG_IDF_TARGET_ESP32P4
#define RX1 (gpio_num_t)11
#endif
#endif

Expand All @@ -180,6 +186,8 @@ typedef enum {
#define TX1 (gpio_num_t)5
#elif CONFIG_IDF_TARGET_ESP32H2
#define TX1 (gpio_num_t)1
#elif CONFIG_IDF_TARGET_ESP32P4
#define TX1 (gpio_num_t)10
#endif
#endif
#endif /* SOC_UART_HP_NUM > 1 */
Expand All @@ -192,6 +200,8 @@ typedef enum {
#define RX2 (gpio_num_t)4
#elif CONFIG_IDF_TARGET_ESP32S3
#define RX2 (gpio_num_t)19
#elif CONFIG_IDF_TARGET_ESP32P4
#define RX2 (gpio_num_t)15
#endif
#endif

Expand All @@ -200,6 +210,8 @@ typedef enum {
#define TX2 (gpio_num_t)25
#elif CONFIG_IDF_TARGET_ESP32S3
#define TX2 (gpio_num_t)20
#elif CONFIG_IDF_TARGET_ESP32P4
#define TX2 (gpio_num_t)14
#endif
#endif
#endif /* SOC_UART_HP_NUM > 2 */
Expand Down
6 changes: 6 additions & 0 deletions cores/esp32/chip-debug-report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ static void printPkgVersion(void) {
#elif CONFIG_IDF_TARGET_ESP32H2
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SYS_4_REG, EFUSE_PKG_VERSION);
chip_report_printf("%lu", pkg_ver);
#elif CONFIG_IDF_TARGET_ESP32P4
uint32_t pkg_ver = REG_GET_FIELD(EFUSE_RD_MAC_SYS_2_REG, EFUSE_PKG_VERSION);
chip_report_printf("%lu", pkg_ver);
#else
chip_report_printf("Unknown");
#endif
Expand All @@ -84,6 +87,7 @@ static void printChipInfo(void) {
case CHIP_ESP32C3: chip_report_printf("ESP32-C3\n"); break;
case CHIP_ESP32C6: chip_report_printf("ESP32-C6\n"); break;
case CHIP_ESP32H2: chip_report_printf("ESP32-H2\n"); break;
case CHIP_ESP32P4: chip_report_printf("ESP32-P4\n"); break;
default: chip_report_printf("Unknown %d\n", info.model); break;
}
printPkgVersion();
Expand All @@ -105,6 +109,8 @@ static void printChipInfo(void) {
static void printFlashInfo(void) {
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2
#define ESP_FLASH_IMAGE_BASE 0x1000
#elif CONFIG_IDF_TARGET_ESP32P4
#define ESP_FLASH_IMAGE_BASE 0x2000
#else
#define ESP_FLASH_IMAGE_BASE 0x0000
#endif
Expand Down
10 changes: 5 additions & 5 deletions cores/esp32/esp32-hal-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static bool adcDetachBus(void *pin) {
if (err != ESP_OK) {
return false;
}
#elif !defined(CONFIG_IDF_TARGET_ESP32H2)
#elif (!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4))
err = adc_cali_delete_scheme_line_fitting(adc_handle[adc_unit].adc_cali_handle);
if (err != ESP_OK) {
return false;
Expand Down Expand Up @@ -127,7 +127,7 @@ esp_err_t __analogChannelConfig(adc_bitwidth_t width, adc_attenuation_t atten, i
log_e("adc_cali_create_scheme_curve_fitting failed with error: %d", err);
return err;
}
#elif !defined(CONFIG_IDF_TARGET_ESP32H2) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
#elif (!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
log_d("Deleting ADC_UNIT_%d line cali handle", adc_unit);
err = adc_cali_delete_scheme_line_fitting(adc_handle[adc_unit].adc_cali_handle);
if (err != ESP_OK) {
Expand Down Expand Up @@ -310,7 +310,7 @@ uint32_t __analogReadMilliVolts(uint8_t pin) {
.bitwidth = __analogWidth,
};
err = adc_cali_create_scheme_curve_fitting(&cali_config, &adc_handle[adc_unit].adc_cali_handle);
#elif !defined(CONFIG_IDF_TARGET_ESP32H2) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
#elif (!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
adc_cali_line_fitting_config_t cali_config = {
.unit_id = adc_unit,
.bitwidth = __analogWidth,
Expand Down Expand Up @@ -379,7 +379,7 @@ static bool adcContinuousDetachBus(void *adc_unit_number) {
if (err != ESP_OK) {
return false;
}
#elif !defined(CONFIG_IDF_TARGET_ESP32H2)
#elif (!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4))
err = adc_cali_delete_scheme_line_fitting(adc_handle[adc_unit].adc_cali_handle);
if (err != ESP_OK) {
return false;
Expand Down Expand Up @@ -552,7 +552,7 @@ bool analogContinuous(const uint8_t pins[], size_t pins_count, uint32_t conversi
.bitwidth = __adcContinuousWidth,
};
err = adc_cali_create_scheme_curve_fitting(&cali_config, &adc_handle[adc_unit].adc_cali_handle);
#elif !defined(CONFIG_IDF_TARGET_ESP32H2) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
#elif (!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)) //ADC_CALI_SCHEME_LINE_FITTING_SUPPORTED
adc_cali_line_fitting_config_t cali_config = {
.unit_id = adc_unit,
.bitwidth = __adcContinuousWidth,
Expand Down
Loading
Loading