Would it be possible to implement enums for some magic numbers?
For example, when doing tft.setTextFont(2); could be improved by doing the following:
enumclassFonts{Small=2,Medium=4}
Would it be possible to implement enums for some magic numbers?
For example, when doing tft.setTextFont(2); could be improved by doing the following:
```cpp
enum class Fonts {
Small = 2,
Medium = 4
}
```
voidTFT_eSPI::setTextFont(uint8_tf){textfont=(f>0)?f:1;// Don't allow font 0
}
So this should mean that we could just use a enum : uint8_t, right?
From the TFT library:
```cpp
void TFT_eSPI::setTextFont(uint8_t f)
{
textfont = (f > 0) ? f : 1; // Don't allow font 0
}
```
So this should mean that we could just use a enum : uint8_t, right?
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Would it be possible to implement enums for some magic numbers?
For example, when doing tft.setTextFont(2); could be improved by doing the following:
is a Font value implicitly convertable to int (as needed in the shitty TFT_eSPI lib)
From the TFT library:
So this should mean that we could just use a enum : uint8_t, right?