Skip to content

USB STM32: Don't wrap direct function calls in MBED_ASSERT #11829

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 1 commit into from
Nov 7, 2019

Conversation

facchinm
Copy link
Contributor

@facchinm facchinm commented Nov 6, 2019

Description (required)

Restore USB functionality on STM32 target if -DNDEBUG is specified as CFLAGS

Summary of change (What the change is for and why)

dab09f3 added checks on some functions in the form of MBED_ASSERT on the result.
Compiling with -DNDEBUG elides the call, thus breaking the functionality

This patch restores it, while leaving the return check if compiled with standard profile.

Documentation (Details of any document updates required)

Pull request type (required)

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results (required)

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR
 #include "mbed.h"
 #include "USBSerial.h"

USBSerial ser;

int main() {
      while(true) {
      }
      return 0;
}

Compiling against 355336c with -DNDEBUG doesn't enumerate the USB peripheral.


Reviewers (optional)

@jeromecoutant


Release Notes (required for feature/major PRs)

Summary of changes
Impact of changes
Migration actions required

dab09f3 added checks on some functions in the form of MBED_ASSERT on the result.
Compiling with -NDEBUG elides the call, thus breaking the functionality

This patch restores it, while leaving the return check if compiled with standard profile.
@0xc0170 0xc0170 changed the title [USB][STM32] Don't wrap direct function calls in MBED_ASSERT USB STM32: Don't wrap direct function calls in MBED_ASSERT Nov 6, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 6, 2019

Ci started

@mbed-ci
Copy link

mbed-ci commented Nov 6, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit f70fbc3 into ARMmbed:master Nov 7, 2019
@adbridge
Copy link
Contributor

This is sitting on top of #11675 currently targeting 6.0

@adbridge adbridge added release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 and removed release-version: 5.14.2 labels Nov 18, 2019
@0xc0170 0xc0170 added release-version: 5.15.0-rc1 and removed release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 labels Nov 19, 2019
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.

5 participants