mirror of
https://github.com/G42makes/mp-s7.git
synced 2025-04-07 10:37:36 +00:00
moved around the char in/out functions until I was happy with them, no I'm able to output properly, still no inputs, but cloes
This commit is contained in:
parent
a4811d429c
commit
e05edfb687
28
.gitignore
vendored
28
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/c,c++,cmake,python
|
||||
# Edit at https://www.gitignore.io/?templates=c,c++,cmake,python
|
||||
# Created by https://www.gitignore.io/api/c,c++,cmake,python,vim
|
||||
# Edit at https://www.gitignore.io/?templates=c,c++,cmake,python,vim
|
||||
|
||||
### C ###
|
||||
# Prerequisites
|
||||
@ -196,7 +195,28 @@ dmypy.json
|
||||
# Pyre type checker
|
||||
.pyre/
|
||||
|
||||
# End of https://www.gitignore.io/api/c,c++,cmake,python
|
||||
|
||||
### Vim ###
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-rt-v][a-z]
|
||||
[._]ss[a-gi-z]
|
||||
[._]sw[a-p]
|
||||
|
||||
# Session
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
|
||||
# Temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# Auto-generated tag files
|
||||
tags
|
||||
# Persistent undo
|
||||
[._]*.un~
|
||||
|
||||
# End of https://www.gitignore.io/api/c,c++,cmake,python,vim
|
||||
|
||||
testcode/
|
||||
build/
|
||||
|
@ -59,8 +59,8 @@ int main()
|
||||
|
||||
|
||||
retro::InitConsole();
|
||||
std::string out = "Hello, world.\nEnter \"exit\" to quit.\n";
|
||||
retro::Console::currentInstance->write(out.data(), out.size());
|
||||
//std::string out = "Hello, world.\nEnter \"exit\" to quit.\n";
|
||||
//retro::Console::currentInstance->write(out.data(), out.size());
|
||||
|
||||
pyexec_event_repl_init();
|
||||
for (;;) {
|
||||
@ -70,6 +70,7 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
std::string in;
|
||||
do
|
||||
{
|
||||
@ -77,7 +78,7 @@ int main()
|
||||
out = "You Entered: " + in;
|
||||
retro::Console::currentInstance->write(out.data(), out.size());
|
||||
} while(in != "exit\n");
|
||||
|
||||
*/
|
||||
|
||||
mp_deinit();
|
||||
return 0;
|
||||
@ -93,3 +94,17 @@ extern "C" void gc_collect(void) {
|
||||
gc_collect_end();
|
||||
gc_dump_info();
|
||||
}
|
||||
|
||||
// Receive single character
|
||||
int mp_hal_stdin_rx_chr(void) {
|
||||
unsigned char c = 0;
|
||||
return c;
|
||||
}
|
||||
|
||||
// Send string of given length
|
||||
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
|
||||
//int r = write(1, str, len);
|
||||
retro::Console::currentInstance->write(str, len);
|
||||
//(void)r;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
//#include "retro/Console.h"
|
||||
|
||||
extern "C" {
|
||||
#include <unistd.h>
|
||||
#include "py/mpconfig.h"
|
||||
@ -7,16 +5,3 @@ extern "C" {
|
||||
|
||||
extern "C" int mp_hal_stdin_rx_chr(void);
|
||||
extern "C" void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len);
|
||||
|
||||
// Receive single character
|
||||
int mp_hal_stdin_rx_chr(void) {
|
||||
unsigned char c = 0;
|
||||
return c;
|
||||
}
|
||||
|
||||
// Send string of given length
|
||||
void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
|
||||
//int r = write(1, str, len);
|
||||
//retro::Console::currentInstance->write(str, len);
|
||||
//(void)r;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user