Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Code clean-up #28

Merged
merged 5 commits into from
Jun 26, 2021
Merged

Code clean-up #28

merged 5 commits into from
Jun 26, 2021

Conversation

conradopoole
Copy link
Collaborator

@conradopoole conradopoole commented Jun 26, 2021

  • 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 it's 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

This would also fix the S3 chipmagic detection.
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.
@conradopoole conradopoole changed the title Cleanupcode Code clean-up Jun 26, 2021
@balloob balloob merged commit b944aff into NabuCasa:main Jun 26, 2021
balloob pushed a commit that referenced this pull request Mar 25, 2022
Fix Mac Address for S2 and S3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants