espressif / esp-idf-cxx

C++ wrapper classes for ESP-IDF components.
Apache License 2.0
79 stars 14 forks source link

Declaring methods of some GPIO user end classes const #18

Closed jordeam closed 1 year ago

jordeam commented 1 year ago

Declaring some methods of GPIO_Output, GPIOInput and GPIO_OpenDrain as const allows user to declare objects from that class to be const, which makes it possible to the object be mapped in Flash or better to be optimized by compiler, do not generating waste of memory. Once those methods do not change object internal value, they are actually const. And by previous definition, as they descend from StrongValue uint32, they would be allocated in RAM, which is more valuable, but their number is expected not to change.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

0xjakob commented 1 year ago

Hi @jordeam, It's merged now! Sorry about the MR being labelled as "Closed" instead of "Merged", but your commit is in the history, unchanged.