Removing #ifdefs embedded into functions #143
aviateur17
started this conversation in
Ideas
Replies: 1 comment
-
Submitted PR #144 to accomplish this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following up on a conversation in a different thread regarding #ifdefs inside functions that are used to enable or disable different features of the gateways and nodes. The main issue is that in the configuration file where there is definition of what actions to take if different kinds of FDRS packets come in from different sources. If you disable ESP-NOW, for example, and a function from the ESP-NOW header file is still listed as an action and the whole ESP-NOW header file is excluded from compile then a compile error will occur. Normally that would require the user to remove that function from the actions however I believe there is a way around that. More defines. So use #ifndef USE_ESPNOW, an example, and then below, provide, what I call, skeleton functions. The only functions needed would be those that would be defined in those actions. Once those functions are provided as "skeleton functions" then whole header files can be removed from compilation and the placement of those #ifdefs inside those files can be completely removed and not worried about.
Beta Was this translation helpful? Give feedback.
All reactions