Add ESP32 series support#14
Draft
Caffreyfans with Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/Caffreyfans/IRbaby-firmware/sessions/13e9a705-0df5-46a4-a934-83dc2fc3a1c2 Co-authored-by: Caffreyfans <39770186+Caffreyfans@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add compatibility support for ESP32 series products
Add ESP32 series support
Apr 21, 2026
Caffreyfans
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The firmware was entirely ESP8266-specific. This PR makes it compile and run on ESP32, ESP32-S2, and ESP32-C3 by replacing or conditionally compiling all platform-specific code.
Platform abstraction
defines.h: Replaced manualtypedefdeclarations with<stdint.h>. Added a platform-independentgetChipId()inline helper:ESP.getChipId()call sites updated to usegetChipId().Build environments
platformio.ini: Addedesp32-base,esp32s2-base,esp32c3-baseenvironments (espressif32platform, LittleFS filesystem). Movedplatformand flash-mode settings into per-environment blocks.Conditional includes & APIs
ESP8266HTTPClient.h→HTTPClient.hon ESP32 (IRbaby.cpp,IRbabyIR.cpp,IRbabyOTA.cpp)ESP8266WiFi.h→WiFi.hon ESP32 (IRbabyUDP.cpp,IRbabyMsgHandler.cpp,IRbabyUserSettings.cpp)ESPhttpUpdate/t_httpUpdate_return→httpUpdate/HTTPUpdateResulton ESP32attach_scheduled()/attach_ms_scheduled()→attach()/attach_ms()(ESP32 Ticker lacks scheduled variants)Filesystem & system APIs
FSInfo64/LittleFS.info64()→FSInfo/LittleFS.info()on ESP32clearBinFiles(): replacedDir-based iteration (ESP8266-only) withFile::openNextFile()on ESP32settingsClear():ESP.eraseConfig()+ESP.reset()→WiFi.disconnect(true, true)+ESP.restart()on ESP32ESP.getFlashChipSpeed()/ESP.getResetReason()guarded under#ifdef ESP8266; ESP32 usesesp_reset_reason()from<esp_system.h>and returns"N/A"for flash speedDevice identity
IRbabyha.cpp: device model field is now"ESP32"or"ESP8266"based on the compile target.