Commit Graph

13 Commits (27bcaa47d563cf8dee8b62a3ee26f7ea9d7390d9)

Author SHA1 Message Date
Martin Kojtal ad759b7749 platform: add spdx license 2018-11-28 10:39:52 +00:00
Cruz Monrreal ec03df4823
Merge pull request #7980 from kjbracey-arm/thread_deprecations
Clean up rtos::Thread deprecation warnings
2018-10-15 10:09:55 -05:00
Cruz Monrreal II 98a9bb880b Merge branch 'fhtidy_doc' of ssh://github.com/kjbracey-arm/mbed-os into kjbracey-arm-fhtidy_doc 2018-10-12 12:07:07 -05:00
Kevin Bracey 1ef213ec89 Clean up Thread deprecation warnings
Static Thread methods and signal methods have been deprecated. Remove
all references in the main code, and most of the tests. Some tests of
the deprecated APIs themselves remain.
2018-10-12 14:57:13 +03:00
Kevin Bracey 1492829f82 poll: Un-doxygen internal comment 2018-09-18 12:40:03 +03:00
Thomas Kemmer a16c374725 Clean up include paths. 2018-08-27 20:47:19 +02:00
Kevin Bracey 39fa676993 Make poll() use RTOS tick count
RTOS maintains a tick count - use it, avoiding issues with sleep and low
power timers.
2018-04-23 14:42:59 +03:00
amq fc412bba5f
Include LowPowerTimer.h 2018-03-28 21:53:35 +02:00
amq 2e9ff4755c Add an option to use LowPowerTimer for poll 2018-03-21 05:05:58 +00:00
Kevin Bracey de4ced33a6 Make poll() use wait(1) rather than yield()
Spinning while polling is overly CPU intensive, and inconsistent with
the current blocking behaviour of UARTSerial.

Change to use Thread::wait(1) to match UARTSerial.
2017-10-03 10:56:19 +03:00
Hasnain Virk c8933e4c71 Removing _poll_change() for now
There is currently no proper wake up mechanism provided
by mbed-os. _poll_change() was supposed to wake upa blocking
poll() in case of a POLL event but the implementation was dependent
upon underlying wake up mechanism. In the absence of conditioanl
variables or some other alternative, _poll_change() wasn't able to
serve its purpose. Removing it for now. Should be implemented at some later stage
2017-05-31 15:02:11 +03:00
Hasnain Virk c65f81bf46 Remove sigio implementation from FileHandle
Make FileHandle more of an interface class, by requiring implementers to
provide the sigio() functionality themselves.

sigio() and poll() remain parallel independent mechanisms, so FileHandle
implementations must trigger both on state changes.
2017-05-31 15:02:11 +03:00
Hasnain Virk b2408d8a16 Extending FileHandle & introducing mbed_poll
This has been an attempt to extend existing FileHandle to behave like POSIX
file descriptor for input/output resources/devices too.
This will now provide an abstract indicator/handle any arbitrary file or device
type resource. May be in future, sockets too.

In order to correctly detect availability of read/write a FileHandle, we needed
a select or poll mechanisms. We opted for poll as POSIX defines in
http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html Currently,
mbed::poll() just spins and scans filehandles looking for any events we are
interested in. In future, his spinning behaviour will be replaced with
condition variables.

In retarget.cpp we have introduced an mbed::fdopen() function which is
equivalent to C fdopen(). It attaches a std stream to our FileHandle stream.
newlib-nano somehow does not seem to call isatty() so retarget doesn't work for
device type file handles. We handle this by checking ourselves in
mbed::fdopen() if we wish to attach our stream to std stream.  We also turn off
buffering by C library as our stuff will be buffered already.

sigio() is also provided, matching the API of the Socket class, with a view to
future unification. As well as unblocking poll(), _poll_change calls the user
sigio callback if an event happens, i.e., when FileHandle becomes
readable/writable.
2017-05-31 15:02:11 +03:00