Skip to content
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

Make the code usable when the RTOS is not compiled #68

Closed
wants to merge 1 commit into from
Closed

Conversation

bogdanm
Copy link

@bogdanm bogdanm commented Nov 16, 2017

This code implements a fake Mutex object (that doesn't do anything)
which is only used when the RTOS is not compiled.

This code implements a fake Mutex object (that doesn't do anything)
which is only used when the RTOS is not compiled.
@bogdanm
Copy link
Author

bogdanm commented Nov 16, 2017

@deepikabhavnani @geky
Background: we're trying to reduce the code size in our bootloader, and one of the things that we're getting rid of is the RTOS. This library needs a fix so that it can be used in non-RTOS environments. This is probably not the best place for a fake Mutex object, but I created this PR so that we can discuss possible solution.
@LiyouZhou @marcuschangarm

@marcuschangarm
Copy link

I think you should put it into mbed OS proper. There is already precedence for no-rtos implementation of core code: https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_wait_api_no_rtos.c

We have a whole set of block devices and other libraries that already have Mutex included. Putting it in mbed OS would solve the problem once and for all.

@deepikabhavnani
Copy link

deepikabhavnani commented Nov 16, 2017

Non-rtos implementation in mbed-os is taken care of. See https://github.com/ARMmbed/mbed-os/blob/7b428916f5b35da28a1b18e2c149c1115bb89d92/platform/PlatformMutex.h for more information. All drivers use PlatformMutex instead of rtos::mutex.

@geky - Any idea/background why PlatformMutex was not used in SD driver?

@geky
Copy link
Contributor

geky commented Nov 16, 2017

@geky - Any idea/background why PlatformMutex was not used in SD driver?

There's not a reason, they should all be using PlatformMutex. 👍

Though IMO the Mutex class should behave this way by default.

@deepikabhavnani
Copy link

@bogdanm - Please try PlatformMutex and let us know the results.

@bogdanm
Copy link
Author

bogdanm commented Nov 16, 2017

@deepikabhavnani It works with PlatformMutex. As a side effect, I can just add Mutex=PlatformMutex in the macros section of my mbed_app.json, and the code just compiles :) Of course that's not the proper fix, but it does mean that I don't need this PR anymore. So I'll close it and I'll add an issue.

@bogdanm bogdanm closed this Nov 16, 2017
@bogdanm bogdanm deleted the no_rtos branch November 16, 2017 18:25
@marcuschangarm
Copy link

I can just add Mutex=PlatformMutex in the macros section of my mbed_app.json, and the code just compiles :)

I'm feeling dirty just by reading that comment! 😄

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

Successfully merging this pull request may close these issues.

4 participants