Conversation
ProfFan
left a comment
There was a problem hiding this comment.
Please also check the simulation code in examples and make sure that the SPI commands that got sent matches the original
|
Thank you for the PR! Just saw your PR notes. These commands have to be done with a lot of caution. Basically I took the lazy approach by using |
|
Tks for the comments. I will undo the changes to use |
8e3376c to
a2eb986
Compare
|
I ran the example and the real-world test on my fleet of boards and got all the correct messages. Let me know if we need to test something more specific. I will look deeper into the |
|
My bad. I was testing some experimental timing filters and forgot to stash them. I just updated it, and it should be fine now. |
|
🤦🏻 clicked on the wrong button |
|
Thank you @max2320 ! |
This PR aims to simplify the creation of targeted messages to support Frame Filtering and prevent additional logic after the receive cycle to discard messages.
The new workflow consists of having a helper method to build the IEEE 802.15.4 MAC frames without having to import the whole chain from
smoltcpand to make sure all the messages created and sent follow the same pattern across, also unifies the workflow, reducing the code duplication that was occurring before between the send actions shaving some computing cycles and improving the maintenance.flowchart LR A[send] --> B[send_to] --> C[send_raw] D[send_frame] --> C[send_raw] C[send_raw] --> U1[ 1 resets 2 populates buffer 3 apply settings 4 set delays 5 returns the sending instance ]Additions:
send_to(): method to permit target framesclear_event_counter(): helper method to clear event counter (evc_ctrl->evc_clr)enable_event_counter(): helper method to re-enable the event counter (evc_ctrl->evc_en)enable_tx_clock(): helper to enable tx clock (clk_ctrl->tx_clk)build_frame_header(): method to aid the creation of IEEE 802.15.4 MAC frame header with the given targetsbuild_frame(): method to populate formated IEEE 802.15.4 MAC frame buffers including the data payloadNote: During my tests, replacing some of the
modifywithwritedecreased the execution cycles, sometimes by 1/3 of the original time to send the same payload(I am using a microsecond timestamp log on an esp32 and basic diff math to get these numbers). I understand that we might need to read some data in some instances, but I haven't found any reason to leave the param available. Let me know if you know a reason to keep the other original.