Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ca765bb5e8a
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ce12d58fa67a
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Dec 31, 2019

  1. Copy the full SHA
    ce12d58 View commit details
Showing with 6 additions and 2 deletions.
  1. +6 −2 software/glasgow/applet/sensor/bmp280/__init__.py
8 changes: 6 additions & 2 deletions software/glasgow/applet/sensor/bmp280/__init__.py
Original file line number Diff line number Diff line change
@@ -162,6 +162,7 @@ async def _read_reg24(self, reg):
return value

async def reset(self):
await self._iface.reset()
await self._write_reg8(REG_RESET, BIT_RESET)

async def identify(self):
@@ -248,6 +249,9 @@ def __init__(self, interface, logger, i2c_address):
self.lower = interface
self._i2c_addr = i2c_address

async def reset(self):
await self.lower.reset()

async def read(self, addr, size):
await self.lower.write(self._i2c_addr, [addr])
result = await self.lower.read(self._i2c_addr, size)
@@ -358,8 +362,8 @@ async def report():
await asyncio.wait_for(report(), args.interval * 2)
except BMP280Error as error:
await data_logger.report_error(str(error), exception=error)
await bmp280.lower.reset()
await bmp280.reset()
except asyncio.TimeoutError as error:
await data_logger.report_error("timeout", exception=error)
await bmp280.lower.reset()
await bmp280.reset()
await asyncio.sleep(args.interval)