Replies: 4 comments
-
+1 as I've recently found a minor bug resulting from an accidental ifdef HAS_. |
Beta Was this translation helpful? Give feedback.
-
Definitely #if, that way compiler complains if headers are messed up. |
Beta Was this translation helpful? Give feedback.
-
Small contribution towards this: #3733 |
Beta Was this translation helpful? Give feedback.
-
https://github.com/search?q=repo%3Ameshtastic%2Ffirmware+%22%23ifdef+HAS_%22&type=code I think the only place for definition checks should be in configuration.h like #ifndef HAS_WIFI
#define HAS_WIFI 0
#endif
|
Beta Was this translation helpful? Give feedback.
-
There are 32 uses of
#if HAS_[...]
and 28 of#ifdef HAS_[...]
, we should standardise on one.We would need to make sure
#elif
,#ifndef
, etc. are also made uniform and#else
behaviours are consistent before and after the change.I am in favour of using
#if HAS_
, and having a file, as we currently do, which has the default 1 or 0 values. This alleviates the need to makeHAS_[...]
keywords have a polarity of the default option, and we can make allHAS_[...]
names positive, so 1 clearly enables, and 0 disables that feature.Beta Was this translation helpful? Give feedback.
All reactions