From 015a3b857c507d51298a74355ac57c65ff2a9806 Mon Sep 17 00:00:00 2001 From: Jonathan Oakley Date: Wed, 21 Sep 2022 14:37:19 +0100 Subject: [PATCH] Fix warnings raised by gcc toolchain 11.3.1 --- examples/BarometricPressureSensor/BarometricPressureSensor.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/BarometricPressureSensor/BarometricPressureSensor.ino b/examples/BarometricPressureSensor/BarometricPressureSensor.ino index d186be0..5dde280 100644 --- a/examples/BarometricPressureSensor/BarometricPressureSensor.ino +++ b/examples/BarometricPressureSensor/BarometricPressureSensor.ino @@ -77,7 +77,7 @@ void loop() { //Read the pressure data lower 16 bits: unsigned int pressure_data_low = readRegister(0x20, 2); //combine the two parts into one 19-bit number: - long pressure = ((pressure_data_high << 16) | pressure_data_low)/4; + long pressure = (((long) pressure_data_high << 16) | pressure_data_low)/4; // display the temperature: Serial.println("\tPressure [Pa]=" + String(pressure)); @@ -150,4 +150,3 @@ void writeRegister(byte thisRegister, byte thisValue) { // release control of the SPI port SPI.endTransaction(); } -