-
Notifications
You must be signed in to change notification settings - Fork 25
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
FreeRTOS: A few small fixes to make the FreeRTOS port simpler #5
Open
alistair23
wants to merge
1
commit into
Azure:master
Choose a base branch
from
alistair23:alistair/fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ping! |
1 similar comment
Ping! |
chweimer
reviewed
Jan 25, 2021
chweimer
reviewed
Jan 25, 2021
alistair23
force-pushed
the
alistair/fixes
branch
from
April 27, 2021 01:12
f287d65
to
cf7a166
Compare
Add a default send and receive function that can be used. Currently cmd_channel_freertos.c includes a receive and send function, but these can't directly be called from struct cmd_channel. Let's add default implementations that can be used. The queue being global allows it to be accessed from interrupt service routines (ISRs) which is generally where the data will be processed, at least for receives. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
alistair23
force-pushed
the
alistair/fixes
branch
from
May 11, 2021 05:52
cf7a166
to
0271943
Compare
chweimer
reviewed
Aug 10, 2021
void cmd_channel_packet_default_init (struct cmd_channel *channel) | ||
{ | ||
channel->receive_packet = cmd_channel_receive_packet; | ||
channel->send_packet = cmd_channel_send_packet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're looking to turn this into a proper implementation of cmd_channel and do it in way that is consistent with the overall architecture and existing coding style, we would do the following:
- Define a new 'struct cmd_channel_freertos' that derives from cmd_channel. This new structure would contain the Rx and Tx queues necessary for receive_packet and send_packet, removing the dependencies on any global context.
- Create cmd_channel_freertos_init and cmd_channel_freertos_release functions to initialize and free the instance. The init function returns int (returning error for null parameters), while release returns void (probably with an empty implementation since nothing would be internally created).
- The init function would take the cmd_channel_freertos instance to initialize and the Rx and Tx queue instances to use with the channel. It would save these internally and set the function pointers.
- The functions you have here as cmd_channel_receive_packet/send_packet would be named cmd_channel_freertos_receive_packet/send_packet, which would probably require a name change of the existing functions. No comment block is necessary on these functions since they are implementations of a base API.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This contains two commits that help when porting to FreeRTOS.