-2

I am trying to port Lua to ucos on a arm9 cpu. lua source code has usd stdio lib at many place. Yet, no uart is left for stdin/sdout ect in my hardware. More worse, the compile of ADS use the semihosting if stdio is used.

So I wanto to avoid using stdio in lua or just redirect stdio to some buffer in memory!

How can I achieve this?

vinge
  • 1
  • 1

2 Answers2

0

The only part of Lua that uses stdio is the io library and the bundled interpreter. You can either simply not include the io library and provide your own interfaces, or patch it suitably. You may also need to overwrite print, which is in the base library set.

rjek
  • 56
  • 1
0

You can use io.input / io.output to redirect standard input and output. You will need to re-implement print in terms of io.write too.

catwell
  • 6,770
  • 1
  • 23
  • 21