mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-20 04:01:14 +00:00
fix #68 (@girtsf, pls review - ps: no worries ;-) )
// We don't set useDisplay until setup() is called, because some boards have a declaration of this object but the device // is never found when probing i2c and therefore we don't call setup and never want to do (invalid) accesses to this device.
This commit is contained in:
parent
9b0e329bb9
commit
11d57e721a
@ -402,7 +402,7 @@ void _screen_header()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
Screen::Screen(uint8_t address, uint8_t sda, uint8_t scl)
|
Screen::Screen(uint8_t address, uint8_t sda, uint8_t scl)
|
||||||
: cmdQueue(32), useDisplay(sda || scl), dispdev(address, sda, scl), ui(&dispdev)
|
: cmdQueue(32), useDisplay(false), dispdev(address, sda, scl), ui(&dispdev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,8 +425,9 @@ void Screen::handleSetOn(bool on)
|
|||||||
|
|
||||||
void Screen::setup()
|
void Screen::setup()
|
||||||
{
|
{
|
||||||
if (!useDisplay)
|
// We don't set useDisplay until setup() is called, because some boards have a declaration of this object but the device
|
||||||
return;
|
// is never found when probing i2c and therefore we don't call setup and never want to do (invalid) accesses to this device.
|
||||||
|
useDisplay = true;
|
||||||
|
|
||||||
dispdev.resetOrientation();
|
dispdev.resetOrientation();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user