24#define APP_NAME "\nnanoForth 2.2 "
44#define log(msg) Serial.print(F(msg))
45#define logx(v) Serial.print((U16)v, HEX)
53#define random(v) (rand()%v)
54#define pgm_read_byte(p) (*(p))
55#define log(msg) ::printf("%s", msg)
56#define logx(v) ::printf("%x", (U16)v)
60#define INLINE inline __attribute__((always_inline))
void exec()
nanoForth execute one line of command input
Definition n4.cpp:27
static void wait(U32 ms)
pause NanoForth thread for ms microseconds, yield to user tasks
Definition n4.cpp:49
void setup(const char *code=0, Stream &io=Serial, U8 ucase=0)
placeholder for extra setup
Definition n4.cpp:20
static void yield()
nanoForth yield to user tasks
Definition n4.cpp:42
static void call_api(U16 id)
call C API interface
Definition n4.cpp:33
static FPTR api[N4_API_SZ]
C API function pointer slots.
Definition n4.h:9
static void add_api(U16 i, void(*fp)())
Definition n4.cpp:13
uint16_t U16
16-bit unsigned integer, for return stack, and pointers
Definition n4.h:66
S16 DU
16-bit data unit (CELL)
Definition n4.h:76
int32_t S32
32-bit signed integer
Definition n4.h:69
U16 IU
16-bit instruction unit (ADDR)
Definition n4.h:75
uint32_t U32
32-bit unsigned integer, for millis()
Definition n4.h:68
int16_t S16
16-bit signed integer, for general numbers
Definition n4.h:67
#define N4_API_SZ
Definition n4.h:37
uint8_t U8
8-bit unsigned integer, for char and short int
Definition n4.h:65
S32 DU2
Definition n4.h:77
void(* FPTR)()
function pointer
Definition n4.h:70