Skip to content

some pylint fixes #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions adafruit_rfm69.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

from micropython import const

import adafruit_bus_device.spi_device as spi_device
import adafruit_bus_device.spi_device as spidev


__version__ = "0.0.0-auto.0"
Expand Down Expand Up @@ -293,8 +293,8 @@ def __init__(self, spi, cs, reset, frequency, *, sync_word=b'\x2D\xD4',
self._tx_power = 13
self.high_power = high_power
# Device support SPI mode 0 (polarity & phase = 0) up to a max of 10mhz.
self._device = spi_device.SPIDevice(spi, cs, baudrate=baudrate,
polarity=0, phase=0)
self._device = spidev.SPIDevice(spi, cs, baudrate=baudrate,
polarity=0, phase=0)
# Setup reset as a digital output that's low.
self._reset = reset
self._reset.switch_to_output(value=False)
Expand Down Expand Up @@ -585,17 +585,16 @@ def tx_power(self):
if pa0 and not pa1 and not pa2:
# -18 to 13 dBm range
return -18 + self.output_power
elif not pa0 and pa1 and not pa2:
if not pa0 and pa1 and not pa2:
# -2 to 13 dBm range
return -18 + self.output_power
elif not pa0 and pa1 and pa2 and not self.high_power:
if not pa0 and pa1 and pa2 and not self.high_power:
# 2 to 17 dBm range
return -14 + self.output_power
elif not pa0 and pa1 and pa2 and self.high_power:
if not pa0 and pa1 and pa2 and self.high_power:
# 5 to 20 dBm range
return -11 + self.output_power
else:
raise RuntimeError('Power amplifiers in unknown state!')
raise RuntimeError('Power amplifiers in unknown state!')

@tx_power.setter
def tx_power(self, val):
Expand Down