It now handles deinit, never_reset and sharing tracking. PWM
now runs in the WAIT state as well during a time.sleep().
_reset_ok() was removed because it was called in one spot right
before deinit().
Some PWMOut were also switched to a bitmap for use instead of
reference count. That way init and deinit are idempotent.
Fixes#6589. Fixes#4841. Fixes#4541.
Pre-commit: Fixed compilation error for other ESP32C3/ESP32S3/ESP32H2 boards
Review comment: Removed the self->pin NULL check
Review comment: Using raise_ValueError_invalid_pin when adc_index is not ADC_UNIT1 for ESP32
Review comment: Optimized the code to set data in buffer from DMA results
Fix: For ESP32C3 boards continuing collecting samples after channel mismatch as DMA runs in alternating UNIT mode
Fix: For ESP32S3 and ESP32H2 setting conversion mode to type2
The master_clock_pin was already optional, but not specifying it would
result in a crash. This fixes it, so it really can be omitted, when the
camera module has its own clock source built in.
I wanted to use the idiom
```c
#if GUARD
if (condition) {
alternate code
} else
#else
{
common default code
}
```
idiom, in which the common default code is conditioned both on a
compile-time check and a run-time check. However, I got it wrong
and uncrustify chipped in, adding extra brackets around a following
piece of code and re-indenting it.
* Set nonblock on all accepted sockets. Not just ones for user code.
* Close an open websocket if another is accepted.
* Set debug level to INFO rather than DEBUG because DEBUG crashes
on ESP32-S3 USB OTG.
A crash would occur if an SSL socket was not shut down before
`gc_deinit()`.
I do not fully understand the root cause, but some object deinitialization
/ deallocation prior to `gc_deinit` leaves the SSL object in an
inconsistent state.
Rather than resolve the root cause, instead ensure that the closing of
the user socket also closes the SSL socket.
Closes: #6502