thiagoralves / OpenPLC_Editor

OpenPLC Editor - IDE capable of creating programs for the OpenPLC Runtime
GNU General Public License v2.0
429 stars 207 forks source link

Update esp32.cpp #92

Closed CloudHead84 closed 1 year ago

CloudHead84 commented 1 year ago

Added two possible PWM pins for the PWM_CONTROLLER function block (for now).

Tested on a ESP32 WROOM (devkit v1) board.

Used uno_leonardo_nano_micro_zero.cpp as a template.

Can the board/library selection somehow be globally outside of the HAL-files? I mean the if defined(ESP32)... macro thingys. That would shrink the code inside the Hal files....

thiagoralves commented 1 year ago

The esp32.cpp file is only used for esp32 boards. The reason why #ifdefs were used on the uno_leonardo_nano_micro_zero is because that hal is shared among several other boards (as the name implies). Please refactor your code to remove the unnecessary #ifdefs

CloudHead84 commented 1 year ago

I got you. I will correct that.