Skip to content

Commit 336ab4a

Browse files
committed
Add SerialForTilt nullptr check
1 parent 3d5c24c commit 336ab4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Firmware/RTK_Everywhere/Tilt.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ void beginTilt()
262262
{
263263
tiltSensor = new IM19();
264264

265-
SerialForTilt = new HardwareSerial(1); // Use UART1 on the ESP32 to receive IMU corrections
265+
if (SerialForTilt == nullptr)
266+
SerialForTilt = new HardwareSerial(1); // Use UART1 on the ESP32 to receive IMU corrections
266267

267268
SerialForTilt->setRxBufferSize(1024 * 1);
268269

0 commit comments

Comments
 (0)