Fixed bug of using wrong pin for detach in setup().
Fixed bug of calling ledcAttach() twice for same pin.
Without this fixed I got:
[ 7634][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255
[ 7641][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255
[ 7647][E][esp32-hal-ledc.c:116] ledcAttachChannel(): Pin 255 is already attached to another bus and failed to detach
Without this fixed I got: [ 7634][E][esp32-hal-periman.c:180] perimanGetPinBus(): Invalid pin: 255 [ 7641][E][esp32-hal-periman.c:122] perimanSetPinBus(): Invalid pin: 255 [ 7647][E][esp32-hal-ledc.c:116] ledcAttachChannel(): Pin 255 is already attached to another bus and failed to detach