Skip to content

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Dec 14, 2015

Merges IPC section of old doxygen mainpage and detailed description and enhances it with some introductory text and examples.

Since I have uncrustify run as a pre-commit hook I included some style fixes too in an extra commit.

@miri64 miri64 added Area: doc Area: Documentation Area: core Area: RIOT kernel. Handle PRs marked with this with care! DocTF labels Dec 14, 2015
@miri64 miri64 added this to the Release 2015.12 milestone Dec 14, 2015
@OlegHahm OlegHahm mentioned this pull request Dec 14, 2015
24 tasks
@miri64
Copy link
Member Author

miri64 commented Dec 14, 2015

Arch users be advices that there is a bug in the most current doxygen version regarding the fenced code block syntax: https://bugzilla.gnome.org/show_bug.cgi?id=759177

* To send a message synchronous to a thread one uses the function
* @ref msg_send_receive(). It sends a message and blocks the sending thread
* until a response is received. The receiving thread uses the function
* @ref msg_receive() to receive this message and must must reply to it with
Copy link
Contributor

Choose a reason for hiding this comment

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

must must

@kaspar030
Copy link
Contributor

thx for taking the time to create examples!

@miri64
Copy link
Member Author

miri64 commented Dec 14, 2015 via email

@miri64
Copy link
Member Author

miri64 commented Dec 14, 2015

addressed comments

*
* Additionally, one can use @ref msg_send_receive() to simultaneously block
* the sending thread and expect a response response from the receiving thread.
* The receiving thread must use @ref msg_reply() to reply to the message of
Copy link
Contributor

Choose a reason for hiding this comment

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

"In this case, ..."

@kaspar030
Copy link
Contributor

minor comments, but from my side, you can squash.

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 14, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 14, 2015

Addressed comments and squashed immediately.

@miri64
Copy link
Member Author

miri64 commented Dec 14, 2015

Does this need to ACKs due to it [edit]technically[/edit] being a core change?

@kaspar030
Copy link
Contributor

nah. The two line code change doesn't chang anything semantically, so one ACK is OK.

* Non-blocking IPC
* ----------------
* For the non-blocking variant use @ref msg_try_send() or
* @ref msg_try_receive() respectively. If a message is send in synchronous
Copy link
Contributor

Choose a reason for hiding this comment

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

"is sent"

@kaspar030
Copy link
Contributor

found two more typos... fix if you feel like... IMHO we should skip travis on this (all but the static tests that check the docs).

* respectively.
*
* Additionally, one can use @ref msg_send_receive() to simultaneously block
* the sending thread and expect a response response from the receiving thread.
Copy link
Member

Choose a reason for hiding this comment

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

response response

* }
* ~~~~~~~~~~~~~~~~~~~~~~~~
*
* Time & messages
Copy link
Member

Choose a reason for hiding this comment

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

How about "Timing & messages"?

@PeterKietzmann
Copy link
Member

Thanks Martine for taking the initiative! No need to discuss on my proposed changes, adapt what you take as reasonable.

@miri64
Copy link
Member Author

miri64 commented Dec 15, 2015

Addressed last batch of comments.

* mode or the message queue (see below) of the receiving thread is full
* messages sent this way will be dropped.
*
* You can use the example on asynchronous IPC below but without the queue for
Copy link
Member

Choose a reason for hiding this comment

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

"for" too much I guess

@PeterKietzmann
Copy link
Member

@authmillenon sorry being so picky, but now that you're on it ;-) ! IMO it's fine to squash

@miri64
Copy link
Member Author

miri64 commented Dec 15, 2015

Addressed comments and squashed

@PeterKietzmann
Copy link
Member

ACK from my side. @kaspar030 please have a look and merge then!!!

@@ -148,7 +281,7 @@ int msg_send_int(msg_t *m, kernel_pid_t target_pid);
*/
static inline int msg_sent_by_int(const msg_t *m)
{
return (m->sender_pid == KERNEL_PID_ISR);
return m->sender_pid == KERNEL_PID_ISR;
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove these parens?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's in the piggybacked uncrustify commit.

Copy link
Member

Choose a reason for hiding this comment

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

I guess we have to fix some settings there.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's one expression, so as far as I understand your parenthesis rules this should be right...

Copy link
Member Author

Choose a reason for hiding this comment

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

(for e.g. two expressions the parenthesis would be kept around each)

Copy link
Member

Choose a reason for hiding this comment

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

"My" rule is basically always to have parens around any condition. Especially, I don't see any reason to remove them.

Copy link
Member

Choose a reason for hiding this comment

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

IMO ignore sounds good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed and squashed immediately.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

thx

@miri64
Copy link
Member Author

miri64 commented Dec 16, 2015

I'm confused. @PeterKietzmann did you ACK or do you want @kaspar030 to ACK?

@kaspar030
Copy link
Contributor

IMHO its fine. Go!

kaspar030 added a commit that referenced this pull request Dec 16, 2015
core: msg: update detail section on IPC
@kaspar030 kaspar030 merged commit 1d22374 into RIOT-OS:master Dec 16, 2015
@miri64
Copy link
Member Author

miri64 commented Dec 16, 2015

Release version in #4496

@miri64 miri64 deleted the doc/enh/msg branch December 16, 2015 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants