Console.ex enhancements
Added support for `Console.print/1` nif and `Console.flush/0`
port call in exavmlib.
#
defmodule Console do
+ @compile {:no_warn_undefined, [:console]}
@compile {:no_warn_undefined, [AVMPort]}
+ def print(string),
+ do: :console.print(string)
+
def puts(device \\ :stdio, item) do
pid =
case :erlang.whereis(device) do
@@ -44,4 +48,7 @@ defmodule Console do
defp write(console, string),
do: AVMPort.call(console, {:puts, string})
+
+ def flush(console \\ :erlang.whereis(:stdio)),
+ do: AVMPort.call(console, :flush)
end
