mirror of https://github.com/MLXXXp/Arduboy2.git
Make width and height constexpr
This allows these functions to be used as constant expressions.
This commit is contained in:
parent
096aaac8dd
commit
a31e5091d6
|
@ -298,10 +298,6 @@ void Arduboy2Core::displayOn()
|
||||||
bootOLED();
|
bootOLED();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Arduboy2Core::width() { return WIDTH; }
|
|
||||||
|
|
||||||
uint8_t Arduboy2Core::height() { return HEIGHT; }
|
|
||||||
|
|
||||||
|
|
||||||
/* Drawing */
|
/* Drawing */
|
||||||
|
|
||||||
|
|
|
@ -435,23 +435,15 @@ class Arduboy2Core
|
||||||
* Get the width of the display in pixels.
|
* Get the width of the display in pixels.
|
||||||
*
|
*
|
||||||
* \return The width of the display in pixels.
|
* \return The width of the display in pixels.
|
||||||
*
|
|
||||||
* \note
|
|
||||||
* In most cases, the defined value `WIDTH` would be better to use instead
|
|
||||||
* of this function.
|
|
||||||
*/
|
*/
|
||||||
uint8_t static width();
|
constexpr uint8_t static width() { return WIDTH; }
|
||||||
|
|
||||||
/** \brief
|
/** \brief
|
||||||
* Get the height of the display in pixels.
|
* Get the height of the display in pixels.
|
||||||
*
|
*
|
||||||
* \return The height of the display in pixels.
|
* \return The height of the display in pixels.
|
||||||
*
|
|
||||||
* \note
|
|
||||||
* In most cases, the defined value `HEIGHT` would be better to use instead
|
|
||||||
* of this function.
|
|
||||||
*/
|
*/
|
||||||
uint8_t static height();
|
constexpr uint8_t static height() { return HEIGHT; }
|
||||||
|
|
||||||
/** \brief
|
/** \brief
|
||||||
* Get the current state of all buttons as a bitmask.
|
* Get the current state of all buttons as a bitmask.
|
||||||
|
|
Loading…
Reference in New Issue