Skip to content

vfs/stdio: cleanup STDIO mapping for vfs#9790

Merged
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:opt_stdio_vfs
Aug 31, 2018
Merged

vfs/stdio: cleanup STDIO mapping for vfs#9790
jnohlgard merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:opt_stdio_vfs

Conversation

@haukepetersen
Copy link
Copy Markdown
Contributor

@haukepetersen haukepetersen commented Aug 16, 2018

Contribution description

The STDIO code for the vfs module was basically duplicated for stdio_uart and stdio_rtt. This PR unifies this shared code into the vfs module and hooks it into the STDIO intialization for rtt and uart.

IMHO this is not the perfect solution w.r.t. to the duplicated 3 line 'ifdefs' in the stdio implementations, but it improves the situation a bit. So I think this is a good intermediate step, until we find a more elegant structure for some of the STDIO code in general (e.g. separate ethos and stdio_uart even more, integrate slip, etc).

Issues/PRs references

based on #9503

@haukepetersen haukepetersen added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 16, 2018
@basilfx
Copy link
Copy Markdown
Member

basilfx commented Aug 28, 2018

I think this one needs a rebase.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

rebased as #9503 is now merged.

Copy link
Copy Markdown
Member

@vincent-d vincent-d left a comment

Choose a reason for hiding this comment

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

Reviewed only from my phone, but looks OK. Maybe @gebart opinion could be valuable as well.

Copy link
Copy Markdown
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

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

Looks good, tested on frdm-k64f. Please fix the typos before merging

#include "stdio_base.h"
#include "vfs.h"

static ssize_t _stio_read(vfs_file_t *filp, void *dest, size_t nbytes)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo: stio -> stdio

* @brief VFS file operation table for stdin/stdout/stderr
*/
static vfs_file_ops_t _stdio_ops = {
.read = _stio_read,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

typo

@haukepetersen
Copy link
Copy Markdown
Contributor Author

fixed typo

@jnohlgard jnohlgard added this to the Release 2018.10 milestone Aug 31, 2018
@jnohlgard jnohlgard merged commit 31c6321 into RIOT-OS:master Aug 31, 2018
@haukepetersen haukepetersen deleted the opt_stdio_vfs branch September 12, 2018 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants