API runs. no output seen?
This commit is contained in:
parent
66f574201c
commit
c206870db8
6 changed files with 14 additions and 9 deletions
|
@ -15,12 +15,15 @@ void setup() {
|
||||||
// Pin 13 has an LED connected on most Arduino boards:
|
// Pin 13 has an LED connected on most Arduino boards:
|
||||||
//pinMode(13, OUTPUT);
|
//pinMode(13, OUTPUT);
|
||||||
LogOut.begin(9600);
|
LogOut.begin(9600);
|
||||||
delay(10000); // TODO remove this
|
|
||||||
|
|
||||||
|
debug_log("Setting up matrix");
|
||||||
setup_matrix();
|
setup_matrix();
|
||||||
|
debug_log("Matrix initted, starting lua");
|
||||||
l_init();
|
l_init();
|
||||||
|
debug_log("Lua started");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
//debug_log("Lua frame");
|
||||||
l_frame();
|
l_frame();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ ARDUINO_DIR = /home/ryan/arduino/1.0.6/arduino-1.0.6/
|
||||||
CFLAGS += -Iinclude -Llib -llua -flto #-DSEND_NON_BLOCKING=1
|
CFLAGS += -Iinclude -Llib -llua -flto #-DSEND_NON_BLOCKING=1
|
||||||
CXXFLAGS += -Iinclude -Llib -llua -flto #-DSEND_NON_BLOCKING=1
|
CXXFLAGS += -Iinclude -Llib -llua -flto #-DSEND_NON_BLOCKING=1
|
||||||
# CPPFLAGS += -DSEND_NON_BLOCKING=1
|
# CPPFLAGS += -DSEND_NON_BLOCKING=1
|
||||||
# LDFLAGS += -flto
|
LDFLAGS += -flto
|
||||||
OTHER_OBJS += lib/liblua.a
|
OTHER_OBJS += lib/liblua.a
|
||||||
|
|
||||||
include ../extern/Arduino-Makefile/Teensy.mk
|
include ../extern/Arduino-Makefile/Teensy.mk
|
||||||
|
|
|
@ -98,7 +98,6 @@ void _output_log(const char *file, const char* function, const int line, int mes
|
||||||
sprintf(buff, "%X", message);
|
sprintf(buff, "%X", message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_write_ring(buff);
|
_write_ring(buff);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,9 @@ ssize_t _write(int fd, const void *buf, size_t count) {return -1;}
|
||||||
char l_prog_buff[MAX_PRGMSIZE] = "function main()\n"
|
char l_prog_buff[MAX_PRGMSIZE] = "function main()\n"
|
||||||
" local i = 0\n"
|
" local i = 0\n"
|
||||||
" while true do\n"
|
" while true do\n"
|
||||||
" local c = ColorHSV(i % 360, 255, 255)\n"
|
" local c = matrixpanel.colorHSV(120, 255, 255)\n"
|
||||||
" i = i + 1\n"
|
" i = i + 1\n"
|
||||||
" drawFastVLine(i % 32, 0, 16, c)\n"
|
" matrixpanel.drawFastVLine(i % 32, 0, 16, c)\n"
|
||||||
" end\n"
|
" end\n"
|
||||||
"end\n";
|
"end\n";
|
||||||
/* "function main()\n"
|
/* "function main()\n"
|
||||||
|
@ -79,12 +79,12 @@ static void l_memstats() {
|
||||||
|
|
||||||
// I want to replace this with an arena allocator so that i can get better memory performance in the future
|
// I want to replace this with an arena allocator so that i can get better memory performance in the future
|
||||||
static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
|
static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
|
||||||
l_memstats();
|
// l_memstats();
|
||||||
|
|
||||||
//"\t->alloc called: 12345678 12345678 12345 12345";
|
//"\t->alloc called: 12345678 12345678 12345 12345";
|
||||||
char buff[64];
|
// char buff[64];
|
||||||
sprintf(buff, "\t->alloc called: %08X %08X %05d %05d", (size_t) ud, (size_t) ptr, osize, nsize);
|
// sprintf(buff, "\t->alloc called: %08X %08X %05d %05d", (size_t) ud, (size_t) ptr, osize, nsize);
|
||||||
debug_log(buff);
|
// debug_log(buff);
|
||||||
|
|
||||||
(void)ud; (void)osize; /* not used */
|
(void)ud; (void)osize; /* not used */
|
||||||
if (nsize == 0) {
|
if (nsize == 0) {
|
||||||
|
|
|
@ -326,5 +326,6 @@ static const struct luaL_Reg matrixpanel_methods[] = {
|
||||||
|
|
||||||
int luaopen_matrixpanel (lua_State* L) {
|
int luaopen_matrixpanel (lua_State* L) {
|
||||||
luaL_newlib(L, matrixpanel_methods);
|
luaL_newlib(L, matrixpanel_methods);
|
||||||
|
lua_setglobal(L, "matrixpanel");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@ void setup_matrix() {
|
||||||
// Some defaults
|
// Some defaults
|
||||||
matrixpanel.setTextWrap(false);
|
matrixpanel.setTextWrap(false);
|
||||||
matrixpanel.setFont(&TomThumb);
|
matrixpanel.setFont(&TomThumb);
|
||||||
|
matrixpanel.fillScreen(0xFFFF);
|
||||||
|
matrixpanel.swapBuffers(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop_matrix() {
|
void loop_matrix() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue