@@ -90,7 +90,7 @@ uint8_t CayenneLppAddAnalogInput( uint8_t channel, float value )
9090 return 0 ;
9191 }
9292
93- int16_t val = value * 100 ;
93+ int16_t val = ( int16_t ) ( value * 100 ) ;
9494 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
9595 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_ANALOG_INPUT ;
9696 CayenneLppBuffer [CayenneLppCursor ++ ] = val >> 8 ;
@@ -105,7 +105,7 @@ uint8_t CayenneLppAddAnalogOutput( uint8_t channel, float value )
105105 {
106106 return 0 ;
107107 }
108- int16_t val = value * 100 ;
108+ int16_t val = ( int16_t ) ( value * 100 ) ;
109109 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
110110 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_ANALOG_OUTPUT ;
111111 CayenneLppBuffer [CayenneLppCursor ++ ] = val >> 8 ;
@@ -148,7 +148,7 @@ uint8_t CayenneLppAddTemperature( uint8_t channel, float celsius )
148148 {
149149 return 0 ;
150150 }
151- int16_t val = celsius * 10 ;
151+ int16_t val = ( int16_t ) ( celsius * 10 ) ;
152152 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
153153 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_TEMPERATURE ;
154154 CayenneLppBuffer [CayenneLppCursor ++ ] = val >> 8 ;
@@ -165,7 +165,7 @@ uint8_t CayenneLppAddRelativeHumidity( uint8_t channel, float rh )
165165 }
166166 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
167167 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_RELATIVE_HUMIDITY ;
168- CayenneLppBuffer [CayenneLppCursor ++ ] = rh * 2 ;
168+ CayenneLppBuffer [CayenneLppCursor ++ ] = ( uint8_t ) ( rh * 2 ) ;
169169
170170 return CayenneLppCursor ;
171171}
@@ -176,9 +176,9 @@ uint8_t CayenneLppAddAccelerometer( uint8_t channel, float x, float y, float z )
176176 {
177177 return 0 ;
178178 }
179- int16_t vx = x * 1000 ;
180- int16_t vy = y * 1000 ;
181- int16_t vz = z * 1000 ;
179+ int16_t vx = ( int16_t ) ( x * 1000 ) ;
180+ int16_t vy = ( int16_t ) ( y * 1000 ) ;
181+ int16_t vz = ( int16_t ) ( z * 1000 ) ;
182182
183183 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
184184 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_ACCELEROMETER ;
@@ -198,7 +198,7 @@ uint8_t CayenneLppAddBarometricPressure( uint8_t channel, float hpa )
198198 {
199199 return 0 ;
200200 }
201- int16_t val = hpa * 10 ;
201+ int16_t val = ( int16_t ) ( hpa * 10 ) ;
202202
203203 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
204204 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_BAROMETRIC_PRESSURE ;
@@ -214,9 +214,9 @@ uint8_t CayenneLppAddGyrometer( uint8_t channel, float x, float y, float z )
214214 {
215215 return 0 ;
216216 }
217- int16_t vx = x * 100 ;
218- int16_t vy = y * 100 ;
219- int16_t vz = z * 100 ;
217+ int16_t vx = ( int16_t ) ( x * 100 ) ;
218+ int16_t vy = ( int16_t ) ( y * 100 ) ;
219+ int16_t vz = ( int16_t ) ( z * 100 ) ;
220220
221221 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
222222 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_GYROMETER ;
@@ -236,9 +236,9 @@ uint8_t CayenneLppAddGps( uint8_t channel, float latitude, float longitude, floa
236236 {
237237 return 0 ;
238238 }
239- int32_t lat = latitude * 10000 ;
240- int32_t lon = longitude * 10000 ;
241- int32_t alt = meters * 100 ;
239+ int32_t lat = ( int32_t ) ( latitude * 10000 ) ;
240+ int32_t lon = ( int32_t ) ( longitude * 10000 ) ;
241+ int32_t alt = ( int32_t ) ( meters * 100 ) ;
242242
243243 CayenneLppBuffer [CayenneLppCursor ++ ] = channel ;
244244 CayenneLppBuffer [CayenneLppCursor ++ ] = LPP_GPS ;
0 commit comments