mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 22:52:07 +00:00
guard against a few more null screen pointers
This commit is contained in:
parent
4d1d89644b
commit
7411dd4f0c
@ -961,7 +961,7 @@ void setup()
|
|||||||
screen->setup();
|
screen->setup();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (screen_found.port != ScanI2C::I2CPort::NO_I2C)
|
if (screen_found.port != ScanI2C::I2CPort::NO_I2C && screen)
|
||||||
screen->setup();
|
screen->setup();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,6 +48,8 @@ ProcessMessage WaypointModule::handleReceived(const meshtastic_MeshPacket &mp)
|
|||||||
bool WaypointModule::shouldDraw()
|
bool WaypointModule::shouldDraw()
|
||||||
{
|
{
|
||||||
#if !MESHTASTIC_EXCLUDE_WAYPOINT
|
#if !MESHTASTIC_EXCLUDE_WAYPOINT
|
||||||
|
if (screen == nullptr)
|
||||||
|
return false;
|
||||||
// If no waypoint to show
|
// If no waypoint to show
|
||||||
if (!devicestate.has_rx_waypoint)
|
if (!devicestate.has_rx_waypoint)
|
||||||
return false;
|
return false;
|
||||||
@ -79,6 +81,8 @@ bool WaypointModule::shouldDraw()
|
|||||||
/// Draw the last waypoint we received
|
/// Draw the last waypoint we received
|
||||||
void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void WaypointModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
|
if (screen == nullptr)
|
||||||
|
return;
|
||||||
// Prepare to draw
|
// Prepare to draw
|
||||||
display->setFont(FONT_SMALL);
|
display->setFont(FONT_SMALL);
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
|
@ -34,6 +34,8 @@ ScanI2C::I2CPort MotionSensor::devicePort()
|
|||||||
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN
|
||||||
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
|
if (screen == nullptr)
|
||||||
|
return;
|
||||||
// int x_offset = display->width() / 2;
|
// int x_offset = display->width() / 2;
|
||||||
// int y_offset = display->height() <= 80 ? 0 : 32;
|
// int y_offset = display->height() <= 80 ? 0 : 32;
|
||||||
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
display->setTextAlignment(TEXT_ALIGN_LEFT);
|
||||||
|
Loading…
Reference in New Issue
Block a user