Updating the chip magic detection to make sure the register read is converted to its signed 2's complements form, which is what esptool.py uses for representing the chipmagic and why 0xfff0c101 was not matching before.
0xfff0c101 is the signed 2's compliment hex value for -999167
Stubs for ESP32-S2, ESP32 and ESP8266 updated to the ones found in esptool 3.1
reader.cancel() causes the Promise returned by the read() operation running on the readLoop to return immediately with { value: undefined, done: true } and thus breaking the loop and exiting readLoop();
This means there is no need to have the stopReadLoop to flag the loop and cause it to exit because it was already exiting as soon as the reader.cancel() was called from the setBaudrate method.
Updating the chip magic detection to make sure the register read is converted to its signed 2's complements form, which is what esptool.py uses for representing the chipmagic and why 0xfff0c101 was not matching before.
0xfff0c101 is the signed 2's compliment hex value for -999167
Stubs for ESP32-S2, ESP32 and ESP8266 updated to the ones found in esptool 3.1
reader.cancel() causes the Promise returned by the read() operation running on the readLoop to return immediately with { value: undefined, done: true } and thus breaking the loop and exiting readLoop();
This means there is no need to have the stopReadLoop to flag the loop and cause it to exit because it was already exiting as soon as the reader.cancel() was called from the setBaudrate method.