mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +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
|
||||
|
||||
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()
|
||||
{
|
||||
if (!useDisplay)
|
||||
return;
|
||||
// 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.
|
||||
useDisplay = true;
|
||||
|
||||
dispdev.resetOrientation();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user