Skip to content

Commit

Permalink
Assignment spit in 2 lines (SQ hint)
Browse files Browse the repository at this point in the history
use of result of assignment to object of volatile-qualified type 'volatile uint32_t' (aka 'volatile unsigned int') is deprecated
  • Loading branch information
amandel committed May 8, 2022
1 parent e4eebd9 commit 983cc29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ void HCSR04SensorManager::sendTriggerToSensor(uint8_t sensorId) {
sensor->end = MEASUREMENT_IN_PROGRESS; // will be updated with LOW signal
sensor->numberOfTriggers++;
sensor->measurementRead = false;
sensor->trigger = sensor->start = micros(); // will be updated with HIGH signal
const uint32_t now = micros();
sensor->trigger = now; // will be updated with HIGH signal
sensor->start = now;
digitalWrite(sensor->triggerPin, HIGH);
// 10us are specified but some sensors are more stable with 20us according
// to internet reports
Expand Down

0 comments on commit 983cc29

Please sign in to comment.