Skip to content
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

Rearrange Packet Processing into unique states #16911

Open
ubcheema opened this issue Jan 20, 2025 · 0 comments
Open

Rearrange Packet Processing into unique states #16911

ubcheema opened this issue Jan 20, 2025 · 0 comments
Assignees
Labels

Comments

@ubcheema
Copy link
Contributor

We need to rearrange code in fvc_producer_state so that we do not perform the same checks on a packet repeatedly.
fvc should maintain state and implement state machines in firmware so that we only execute the directly relevant firmware in any given state.

To start, process_inbound_packet() and pull_data_from_fvc_buffer() need to be optimized.

General Plan:
Need array of function pointers that point to different state handlers.

state_handlers[num_states] = {state_1_handler, state_2_handler, ...}

Firmware starts in idle state, and switches to different states based on packet processing state.

The state handler call looks like:

state_handlers[current_state]()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants