API runs. no output seen?

This commit is contained in:
Ryan Voots 2016-04-24 16:36:39 -07:00
parent 66f574201c
commit c206870db8
6 changed files with 14 additions and 9 deletions

View file

@ -15,12 +15,15 @@ void setup() {
// Pin 13 has an LED connected on most Arduino boards:
//pinMode(13, OUTPUT);
LogOut.begin(9600);
delay(10000); // TODO remove this
debug_log("Setting up matrix");
setup_matrix();
debug_log("Matrix initted, starting lua");
l_init();
debug_log("Lua started");
}
void loop() {
//debug_log("Lua frame");
l_frame();
}

View file

@ -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
CXXFLAGS += -Iinclude -Llib -llua -flto #-DSEND_NON_BLOCKING=1
# CPPFLAGS += -DSEND_NON_BLOCKING=1
# LDFLAGS += -flto
LDFLAGS += -flto
OTHER_OBJS += lib/liblua.a
include ../extern/Arduino-Makefile/Teensy.mk

View file

@ -99,7 +99,6 @@ void _output_log(const char *file, const char* function, const int line, int mes
break;
}
_write_ring(buff);
}

View file

@ -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"
" local i = 0\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"
" drawFastVLine(i % 32, 0, 16, c)\n"
" matrixpanel.drawFastVLine(i % 32, 0, 16, c)\n"
" end\n"
"end\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
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";
char buff[64];
sprintf(buff, "\t->alloc called: %08X %08X %05d %05d", (size_t) ud, (size_t) ptr, osize, nsize);
debug_log(buff);
// char buff[64];
// sprintf(buff, "\t->alloc called: %08X %08X %05d %05d", (size_t) ud, (size_t) ptr, osize, nsize);
// debug_log(buff);
(void)ud; (void)osize; /* not used */
if (nsize == 0) {

View file

@ -326,5 +326,6 @@ static const struct luaL_Reg matrixpanel_methods[] = {
int luaopen_matrixpanel (lua_State* L) {
luaL_newlib(L, matrixpanel_methods);
lua_setglobal(L, "matrixpanel");
return 0;
}

View file

@ -8,6 +8,8 @@ void setup_matrix() {
// Some defaults
matrixpanel.setTextWrap(false);
matrixpanel.setFont(&TomThumb);
matrixpanel.fillScreen(0xFFFF);
matrixpanel.swapBuffers(true);
}
void loop_matrix() {