Skip to content

[SDFileSystem] Enable / Disable serial debug. #3093

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

Merged
merged 2 commits into from
Oct 26, 2016

Conversation

BrunoMPires-zz
Copy link
Contributor

Description

  • Added void debug(bool dbg) method to allow enabling/disabling
    serial debug at runtime.
  • Replaced calls to debug with debug_if to prevent messges
    from being thrown via serial when debug is disabled.

Status

READY

Migrations

If this PR changes any APIs or behaviors, give a short description of what API users should do when this PR is merged.

NO

Todos

  • Tests
  • Documentation

Steps to test or reproduce

  1. Create a SDFileSystem instance sd, do not inset card.
  2. Try to create a file at the root directory. Error messages should not be thrown over serial interface.
  3. Issue sd.debug(true) command.
  4. Try to create a file at the root directory. Error messages should be thrown over serial interface..

Signed-off-by: Bruno Monteiro Pires [email protected]

+ Added ``void debug(bool dbg)`` method to allow enabling/disabling
  serial debug at runtime.
+ Replaced calls to ``debug`` with ``debug_if`` to prevent messges
  from being thrown via serial when debug is disabled.

Signed-off-by: Bruno Monteiro Pires <[email protected]>
@@ -58,6 +58,7 @@ class SDFileSystem : public FATFileSystem {
virtual int disk_write(const uint8_t* buffer, uint32_t block_number, uint32_t count);
virtual int disk_sync();
virtual uint32_t disk_sectors();
void debug(bool dbg);
Copy link
Contributor

Choose a reason for hiding this comment

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

using tabs here? some lines in this file and the other are misaligned here on github

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, there were some tabs, i've fixed it.

* Removed missplaced tabs

Signed-off-by: Bruno Monteiro Pires <[email protected]>
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 25, 2016

@c1728p9 please review

@c1728p9
Copy link
Contributor

c1728p9 commented Oct 25, 2016

Looks good to me

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 26, 2016

@BrunoMPires-zz
Copy link
Contributor Author

@0xc0170 sure, just signed!

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

Successfully merging this pull request may close these issues.

4 participants