2022-10-30 18:50:24 +01:00
|
|
|
//---------------------------------------------------------------------------//
|
|
|
|
// ____ PythonExtra //
|
|
|
|
//.-'`_ o `;__, A community port of MicroPython for CASIO calculators. //
|
|
|
|
//.-'` `---` ' License: MIT (except some files; see LICENSE) //
|
|
|
|
//---------------------------------------------------------------------------//
|
|
|
|
|
2022-10-23 23:47:33 +02:00
|
|
|
#include "py/mphal.h"
|
2022-11-05 18:25:54 +01:00
|
|
|
#include "console.h"
|
2022-10-23 23:47:33 +02:00
|
|
|
#include <gint/display.h>
|
|
|
|
#include <gint/keyboard.h>
|
2022-10-30 18:50:24 +01:00
|
|
|
#include <unistd.h>
|
2022-10-23 23:47:33 +02:00
|
|
|
|
2022-10-30 17:53:13 +01:00
|
|
|
int mp_hal_stdin_rx_chr(void)
|
|
|
|
{
|
2022-10-23 23:47:33 +02:00
|
|
|
while(1) {
|
|
|
|
key_event_t ev = getkey();
|
2022-11-05 18:25:54 +01:00
|
|
|
int code_point = console_key_event_to_char(ev);
|
2022-10-23 23:47:33 +02:00
|
|
|
if(code_point != 0)
|
|
|
|
return code_point;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-30 17:53:13 +01:00
|
|
|
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len)
|
|
|
|
{
|
2022-10-23 23:47:33 +02:00
|
|
|
int r = write(STDOUT_FILENO, str, len);
|
|
|
|
(void)r;
|
|
|
|
}
|