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

[ncp-spi] improve callback implementation, change code style format #2734

Merged
merged 1 commit into from Jun 11, 2018

Conversation

Projects
None yet
3 participants
@abtink
Member

abtink commented May 23, 2018

This commit makes the following changes in NcpSpi class:

  • It adds a new class NcpSpi::Header which provide helper
    methods to parse and update the fields in the header of an SPI
    frame.
  • It simplifies/enhances the SpiTransactionComplete() callback
    implementation by combining the parsing of input/output frame
    headers with the rx/tx frame processing.
  • It adds a check for correct pattern bits in a received frame
    flag byte (frames with incorrect pattern bits are ignored).
  • Code format is changed to follow the "pretty" style.

@abtink abtink requested a review from jwhui May 23, 2018

Show outdated Hide outdated src/ncp/ncp_spi.hpp Outdated
Show outdated Hide outdated src/ncp/ncp_spi.hpp Outdated
@abtink

This comment has been minimized.

Show comment
Hide comment
@abtink

abtink May 29, 2018

Member

In new pushed commit, added SpiFrame class.

Member

abtink commented May 29, 2018

In new pushed commit, added SpiFrame class.

Show outdated Hide outdated src/ncp/ncp_spi.cpp Outdated
[ncp-spi] improve callback implementation, change code style format
This commit makes the following changes in `NcpSpi` class:

- It adds a new class `SpiFrame` which provides helper methods to
  parse and update the header fields in the header of an SPI  frame.
- It simplifies/enhances the `SpiTransactionComplete()` callback
  implementation by combining the parsing of input/output frame
  headers with the rx/tx frame processing.
- It adds a check for correct pattern bits in a received frame
  flag byte (frames with incorrect pattern bits are ignored).
- Code format is changed to follow the "pretty" style.
- Fixes a rare issue with a possible incorrect accept length on
  the first SPI transaction after NCP reset.

@abtink abtink removed the work-in-progress label Jun 9, 2018

@abtink

This comment has been minimized.

Show comment
Hide comment
@abtink

abtink Jun 9, 2018

Member

Verified/tested this change on a device with SPI interface (to wpantund).

Member

abtink commented Jun 9, 2018

Verified/tested this change on a device with SPI interface (to wpantund).

@jwhui

jwhui approved these changes Jun 11, 2018

@jwhui jwhui merged commit 90b160c into openthread:master Jun 11, 2018

3 checks passed

cla/google All necessary CLAs are signed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment