Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Write an edoc note on the fact that serial_get_char may hang the emul…


Thanks to Tony Rogvall for the reminder.
  • Loading branch information...
commit bc18c581564ce0d4cb57cea07c16da6bd0dd969c 1 parent 64e613b
@klajo authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/wpi.erl
9 src/wpi.erl
@@ -373,6 +373,15 @@ serial_data_avail(Handle) when is_integer(Handle) ->
-spec serial_get_char(wpi_serial_handle()) -> 0..255.
%% @doc Return the next character available on the serial device.
+%% Warning: This call will block for up to 10 seconds if no data is
+%% available. This has the effect that the emulator will be blocked
+%% (for up to 10s!) and no other process may run (unless there are
+%% more cores/schedulers available). From wiringSerial.c:
+%% ```
+%% options.c_cc [VTIME] = 100 ; // Ten seconds (100 deciseconds)
+%% '''
+%% Todo: Fix the above warning.
serial_get_char(Handle) when is_integer(Handle) ->

0 comments on commit bc18c58

Please sign in to comment.
Something went wrong with that request. Please try again.