mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
A script can now be imported in the console. Moved all the MicroPython functions to python/port files. Change-Id: I0a23e8cb20005719b800e81470e1c574c702c3b7
30 lines
595 B
C++
30 lines
595 B
C++
#ifndef PYTHON_PORT_H
|
|
#define PYTHON_PORT_H
|
|
|
|
namespace MicroPython {
|
|
|
|
class ScriptProvider {
|
|
public:
|
|
virtual const char * contentOfScript(const char * name) = 0;
|
|
};
|
|
|
|
class ExecutionEnvironment {
|
|
public:
|
|
void runCode(const char * );
|
|
virtual void printText(const char * text, size_t length) {
|
|
}
|
|
};
|
|
|
|
void init(void * heapStart, void * heapEnd);
|
|
void deinit();
|
|
void registerScriptProvider(ScriptProvider * s);
|
|
|
|
};
|
|
|
|
// Will implement :
|
|
// mp_lexer_new_from_file -> Ask the context about a file
|
|
// mp_import_stat
|
|
// mp_hal_stdout_tx_strn_cooked -> Tell the context Python printed text
|
|
|
|
#endif
|