Skip to content

Commit 983cc29

Browse files
committed
Assignment spit in 2 lines (SQ hint)
use of result of assignment to object of volatile-qualified type 'volatile uint32_t' (aka 'volatile unsigned int') is deprecated
1 parent e4eebd9 commit 983cc29

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/sensor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ void HCSR04SensorManager::sendTriggerToSensor(uint8_t sensorId) {
253253
sensor->end = MEASUREMENT_IN_PROGRESS; // will be updated with LOW signal
254254
sensor->numberOfTriggers++;
255255
sensor->measurementRead = false;
256-
sensor->trigger = sensor->start = micros(); // will be updated with HIGH signal
256+
const uint32_t now = micros();
257+
sensor->trigger = now; // will be updated with HIGH signal
258+
sensor->start = now;
257259
digitalWrite(sensor->triggerPin, HIGH);
258260
// 10us are specified but some sensors are more stable with 20us according
259261
// to internet reports

0 commit comments

Comments
 (0)