espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.52k stars 7.39k forks source link

Some function not exposed on 3.0.0-alpha #8753

Closed frdoni closed 1 year ago

frdoni commented 1 year ago

Board

ESP32 DEVKIT V1

Device Description

Trying new 3.0.0-alpha version, my sketch don't compile because some internal function seems not be exposed anymore:

error: 'esp_random' was not declared in this scope; did you mean 'srandom'?

error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'?

error: 'ledcSetup' was not declared in this scope

Hardware Configuration

no special configuration

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE V2

Operating System

Win11 x64

Flash frequency

80Mhz

PSRAM enabled

yes

Upload speed

115200

Description

Can't compile on 3.0.0-alpha

Sketch

int i = esp_random() % 10;

ledcSetup(GPIO_NUM_18, 100, 8);

ledcAttachPin(GPIO_NUM_18, 0);

Debug Message

exit status 1

Compilation error: 'esp_random' was not declared in this scope; did you mean 'srandom'?

Other Steps to Reproduce

on 2.0.x version it's compile correctly

I have checked existing issues, online documentation and the Troubleshooting Guide

me-no-dev commented 1 year ago

Functions have changed. Maybe wait for the update guide to come out?

P-R-O-C-H-Y commented 1 year ago

@frdoni LEDC functions have changed, migration guide and documentation is almost ready. For esp_random() function you need add an include #include "esp_random.h".

I am closing this as there won't be any action needed.

atchoo78 commented 1 year ago

@frdoni LEDC functions have changed, migration guide and documentation is almost ready.

Where can I find it? I'm getting ledc errors all over the place.

me-no-dev commented 1 year ago

here is the PR with it being worked on: https://github.com/espressif/arduino-esp32/pull/8716

P-R-O-C-H-Y commented 1 year ago

@frdoni another option to check LEDC API docs source file or reworked examples.

frdoni commented 1 year ago

Thanks !!!

Da: Jan Procházka @.> Inviato: venerdì 13 ottobre 2023 11:51 A: espressif/arduino-esp32 @.> Cc: Francesco @.>; Mention @.> Oggetto: Re: [espressif/arduino-esp32] Some function not exposed on 3.0.0-alpha (Issue #8753)

@frdoni https://github.com/frdoni another option to check LEDC API docs source file https://github.com/espressif/arduino-esp32/blob/master/docs/source/api/ledc.rst or reworked examples https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/AnalogOut .

— Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/8753#issuecomment-1761236773 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AC3LUZU4EIPFP4RLLYZYTJ3X7EFGXAVCNFSM6AAAAAA527C33CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGIZTMNZXGM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AC3LUZWVVAAT4YZC3JZMSK3X7EFGXA5CNFSM6AAAAAA527C33CWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTI7JLSK.gif Message ID: @. @.> >

atchoo78 commented 1 year ago

Thanks, @P-R-O-C-H-Y. I figured it out by looking at the new AnalogOut LEDC examples 👍🏼