Skip to content

Type & remove trailing whitespaces #22

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
8 changes: 4 additions & 4 deletions LoRaRF/SX126x.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class SX126x(BaseLoRa) :
POWER_SAVING_GAIN = 0x94 # power saving gain register value
BOOSTED_GAIN = 0x96 # boosted gain register value

# TX and RX operation status
# TX and RX operation status
STATUS_DEFAULT = 0 # default status (false)
STATUS_TX_WAIT = 1
STATUS_TX_TIMEOUT = 2
Expand Down Expand Up @@ -1036,7 +1036,7 @@ def setRxTxFallbackMode(self, fallbackMode: int) :

def writeRegister(self, address: int, data: tuple, nData: int) :
buf = (
(address >> 8) & 0xFF,
(address >> 8) & 0xFF,
address & 0xFF
) + tuple(data)
self._writeBytes(0x0D, buf, nData+2)
Expand Down Expand Up @@ -1109,7 +1109,7 @@ def setRfFrequency(self, rfFreq: int) :
def setPacketType(self, packetType: int) :
self._writeBytes(0x8A, (packetType,), 1)

def getPakcetType(self) -> int :
def getPacketType(self) -> int :
buf = self._readBytes(0x11, 2)
return buf[1]

Expand Down Expand Up @@ -1222,7 +1222,7 @@ def clearDeviceErrors(self) :
### SX126X API: WORKAROUND FUNCTIONS ###

def _fixLoRaBw500(self, bw: int) :
packetType = self.getPakcetType()
packetType = self.getPacketType()
buf = self.readRegister(self.REG_TX_MODULATION, 1)
value = buf[0] | 0x04
if packetType == self.LORA_MODEM and bw == self.BW_500000 :
Expand Down
4 changes: 2 additions & 2 deletions LoRaRF/SX127x.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def setCurrentProtection(self, current: int) :
self.writeRegister(self.REG_OCP, 0x20 | ocpTrim)

def setOscillator(self, option: int) :

cfg = self.OSC_CRYSTAL
if option == self.OSC_TCXO :
cfg = self.OSC_TCXO
Expand Down Expand Up @@ -354,7 +354,7 @@ def setSpreadingFactor(self, sf: int) :
# set appropriate signal detection optimize and threshold
optimize = 0x03
threshold = 0x0A
if sf == 6 :
if sf == 6 :
optimize = 0x05
threshold = 0x0C
self.writeRegister(self.REG_DETECTION_OPTIMIZE, optimize)
Expand Down
2 changes: 1 addition & 1 deletion examples/SX127x/driver_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def settingFunction() :
print("Set syncWord to 0x{:02X}".format(reg))

def receiveFunction(message: list) :

print("\n-- RECEIVE FUNCTION --")

# Activate interrupt when transmit done on DIO0
Expand Down
2 changes: 1 addition & 1 deletion examples/SX127x/driver_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def settingFunction() :
print("Set syncWord to 0x{:02X}".format(reg))

def transmitFunction(message: list) :

print("\n-- TRANSMIT FUNCTION --")

# Configure FIFO address and address pointer for TX operation
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers =

[options]
include_package_data = True
packages =
packages =
LoRaRF
python_requires = >=2.7
install_requires =
Expand Down