always show console window
This commit is contained in:
parent
643cb31bf3
commit
13431d831b
3 changed files with 11 additions and 12 deletions
|
|
@ -70,6 +70,9 @@ int main(int argc, char **argv) {
|
||||||
size_t heap_size = growmax / 2;
|
size_t heap_size = growmax / 2;
|
||||||
unsigned char *heap = (unsigned char *)NewPtr(growmax / 2);
|
unsigned char *heap = (unsigned char *)NewPtr(growmax / 2);
|
||||||
|
|
||||||
|
// show the console window always
|
||||||
|
mp_hal_stdin_init();
|
||||||
|
|
||||||
// Check if we were given a file ...
|
// Check if we were given a file ...
|
||||||
short message, count;
|
short message, count;
|
||||||
CountAppFiles(&message, &count);
|
CountAppFiles(&message, &count);
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,14 @@ namespace retro
|
||||||
|
|
||||||
#define USE_CONSOLE (1)
|
#define USE_CONSOLE (1)
|
||||||
|
|
||||||
|
void mp_hal_stdin_init(void) {
|
||||||
|
#if USE_CONSOLE
|
||||||
|
if(!Console::currentInstance)
|
||||||
|
InitConsole();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Receive single character
|
// Receive single character
|
||||||
extern "C"
|
|
||||||
int mp_hal_stdin_rx_chr(void);
|
|
||||||
int mp_hal_stdin_rx_chr(void) {
|
int mp_hal_stdin_rx_chr(void) {
|
||||||
#if USE_CONSOLE
|
#if USE_CONSOLE
|
||||||
if(!Console::currentInstance)
|
if(!Console::currentInstance)
|
||||||
|
|
@ -44,8 +49,6 @@ bool mp_hal_stdin_available(void) {
|
||||||
return Console::currentInstance->Available(1);
|
return Console::currentInstance->Available(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
|
||||||
mp_uint_t debug_uart_tx_strn(const char *str, mp_uint_t len);
|
|
||||||
mp_uint_t debug_uart_tx_strn(const char *str, mp_uint_t len) {
|
mp_uint_t debug_uart_tx_strn(const char *str, mp_uint_t len) {
|
||||||
mp_uint_t result = len;
|
mp_uint_t result = len;
|
||||||
// debug hack, needs patched umac
|
// debug hack, needs patched umac
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "py/mpprint.h"
|
#include "py/mpprint.h"
|
||||||
|
|
||||||
|
void mp_hal_stdin_init(void);
|
||||||
bool mp_hal_stdin_available(void);
|
bool mp_hal_stdin_available(void);
|
||||||
int mp_hal_stdin_rx_chr(void);
|
int mp_hal_stdin_rx_chr(void);
|
||||||
extern mp_print_t debug_print;
|
extern mp_print_t debug_print;
|
||||||
mp_uint_t mp_hal_stdout_tx_strn(const char *str, mp_uint_t len);
|
mp_uint_t mp_hal_stdout_tx_strn(const char *str, mp_uint_t len);
|
||||||
#define DEBUG_PRINT(...) mp_printf(&debug_print, __VA_ARGS__)
|
#define DEBUG_PRINT(...) mp_printf(&debug_print, __VA_ARGS__)
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue