Merge pull request #44 from Pharap/make-width-and-height-constexpr

Make width and height constexpr
This commit is contained in:
Scott Allen 2019-05-31 12:22:56 -04:00 committed by GitHub
commit 2fbde21e66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

View File

@ -298,10 +298,6 @@ void Arduboy2Core::displayOn()
bootOLED(); bootOLED();
} }
uint8_t Arduboy2Core::width() { return WIDTH; }
uint8_t Arduboy2Core::height() { return HEIGHT; }
/* Drawing */ /* Drawing */

View File

@ -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.