Skip to content

Radio modes#1

Open
tomyyyD wants to merge 37 commits intodual_rxtxfrom
radio_modes
Open

Radio modes#1
tomyyyD wants to merge 37 commits intodual_rxtxfrom
radio_modes

Conversation

@tomyyyD
Copy link
Copy Markdown

@tomyyyD tomyyyD commented Jun 27, 2023

letting a user easily choose between fsk and lora in radio_configuration.

Copy link
Copy Markdown
Contributor

@jbwillis jbwillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the purpose of unifying FSK and LoRa, I think this does the job. There is a lot of duplicated functionality in radiohead.py between the FSK and LoRa send/receive functions. Ultimately I'd like to reduce those down so FSK and LoRa packets are handled by the same code. This is partly to avoid having two diverging packet protocols making it hard to keep track of bugs and where changes need to be made.

@@ -0,0 +1,689 @@
# SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to pycubed_rfm9x_lora.py

"""crc status"""
return (self._read_u8(Constants._RH_RF95_REG_12_IRQ_FLAGS) & 0x20) >> 5

def write_payload(self, payload) -> bool:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually return a bool?

lib/radiohead.py Outdated
@@ -218,9 +219,14 @@ async def fsk_send(
# efficient and proper way to ensure a precondition that the provided
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably delete these comments

lib/radiohead.py Outdated
assert 0 < len(data) <= 57 # TODO: Allow longer packets, see pg 76
self.tx_device.check_data(data)

# pylint: enable=len-as-condition
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

lib/radiohead.py Outdated
if self.protocol == "lora":
# tells device that FIFO should start at 0.
# register is used different in fsk
self.tx_device._write_u8(self.constants._RH_RF95_REG_0D_FIFO_ADDR_PTR, 0x00)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in a function in the lora module

lib/radiohead.py Outdated
# Enter idle mode to stop receiving other packets.
self.idle()
if self.protocol == "lora":
self.tx_device._write_u8(self.constants._RH_RF95_REG_12_IRQ_FLAGS, 0xFF)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this in a function in the lora module.

@tomyyyD tomyyyD marked this pull request as ready for review July 5, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants