Skip to content

Commit a85507d

Browse files
committed
space alignment of firmware code
1 parent a73745c commit a85507d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

m5stack/libs/driver/qmp6988.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,21 +238,21 @@ def measure(self):
238238

239239
# Compensation based on datasheet section 4.3
240240
d = self.i2c.readfrom_mem(self.addr, _QMP6988_DATA, _QMP6988_DATA_LEN)
241-
dp = ((d[0] << 16) | (d[1] << 8) | d[2]) - 2 ** 23
242-
dt = ((d[3] << 16) | (d[4] << 8) | d[5]) - 2 ** 23
241+
dp = ((d[0] << 16) | (d[1] << 8) | d[2]) - 2**23
242+
dt = ((d[3] << 16) | (d[4] << 8) | d[5]) - 2**23
243243

244-
tr = self.a0 + (self.a1 * dt) + (self.a2 * (dt ** 2))
244+
tr = self.a0 + (self.a1 * dt) + (self.a2 * (dt**2))
245245

246246
pr = (
247247
self.b00
248248
+ (self.bt1 * tr)
249249
+ (self.bp1 * dp)
250250
+ (self.b11 * tr * dp)
251-
+ (self.bt2 * tr ** 2)
252-
+ (self.bp2 * dp ** 2)
253-
+ (self.b12 * dp * (tr ** 2))
254-
+ (self.b21 * (dp ** 2) * tr)
255-
+ (self.bp3 * (dp ** 3))
251+
+ (self.bt2 * tr**2)
252+
+ (self.bp2 * dp**2)
253+
+ (self.b12 * dp * (tr**2))
254+
+ (self.b21 * (dp**2) * tr)
255+
+ (self.bp3 * (dp**3))
256256
)
257257

258258
temperature = (tr / 256) if temp_en else 0.0

m5stack/libs/driver/scd40.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async def start(self):
4848
await self._write_values(_SCD40_CMD_REINIT, delay_ms=1000)
4949
# temperature offset can only be configured in idle mode
5050
if self.temp_offset is not None:
51-
t = int((self.temp_offset * 2 ** 16) / 175)
51+
t = int((self.temp_offset * 2**16) / 175)
5252
await self._write_values(_SCD40_CMD_SET_TEMPERATURE_OFFSET, (t,))
5353

5454
# create background task and wait for measurements to arrive

0 commit comments

Comments
 (0)