You are reading a single comment by @user158605 and its replies. Click here to read the full conversation.
  • Also not shown above but I'm confident I managed to set IO_MUX_GPIO2_REG to x001802 inside my modified Espruino build readADC() before any IDF calls , using api calls in the EspIdf GPIO library. Including gpio_reset_pin()
    and still experienced the same behaviour on multiple analogRead calls, dispute the register being set as above.
    So not sure at all where to go, it does seem Espruino is putting the ADC peripheral in a bad state somehow.

    Edit .. I did not try to modify the Espruino ESP32 pin setting code in jshardware.c, which as you say earlier does not currently have an analog option. And I further note that the esp32-c3 IDF ADC library for IDF v5 is very different to the current and current Espruino ADC handling will need a rewrite anyway. Also current GPIO calls in jshardware.c are using HAL level calls and not the IDF GPIO library API so it looks like quite a bit of change and testing to get to v5 in this area.

About

Avatar for user158605 @user158605 started