-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* decouple linuxfb cairo implementation * screen backend for writing to json * fix writing to json * slow, wrong x11 backend draws something * rename json write functions * replace x11 fb with sdl * select screens to use via lua configuration * lua configuration for screen + input * lua boot config working on norns hw * unified input and screen data structures * update json screen * rename gpio input, add broken sdl input * restore battery_init and fix fprintf werror * require ./waf --desktop flag to include SDL * rm json screen for now, cleanup prints, matronrc fallback * fix matronrc fallback * restore vcgencmd polling * remove old input/fd.c * Remove TrigPhasor * Remove nova-simd * merge * bypass polling SDL input for now * scale up the SDL window Co-authored-by: Sam Boling <[email protected]> Co-authored-by: Sam Boling <[email protected]> Co-authored-by: Artem Popov <[email protected]>
- Loading branch information
1 parent
0fc9606
commit 2b82088
Showing
29 changed files
with
1,105 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
# ignore emacs cruft | ||
\#*\# | ||
.\#* | ||
*.*~ | ||
|
||
# vim | ||
|
Submodule softcut
updated
from a720f2 to 03ef80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
#include <lauxlib.h> | ||
#include <lualib.h> | ||
|
||
#include "lua_eval.h" | ||
#include "hardware/input.h" | ||
#include "hardware/io.h" | ||
#include "hardware/screen.h" | ||
|
||
lua_State *config_lvm; | ||
|
||
static inline void lua_register_func(lua_State *l, const char* name, lua_CFunction func) { | ||
lua_pushcfunction(l, func); | ||
lua_setfield(l, -2, name); | ||
} | ||
|
||
static int _add_io(lua_State *l); | ||
|
||
int config_init(void) { | ||
lua_State *l = config_lvm = luaL_newstate(); | ||
luaL_openlibs(l); | ||
lua_pcall(l, 0, 0, 0); | ||
|
||
lua_newtable(l); | ||
|
||
lua_register_func(l, "add_io", _add_io); | ||
|
||
lua_setglobal(l, "_boot"); | ||
|
||
char *home = getenv("HOME"); | ||
char fname[256]; | ||
snprintf(fname, 256, "%s/matronrc.lua", home); | ||
if (access(fname, R_OK)) { | ||
fprintf(stderr, "no user matronrc file (%s) found, using default\n", fname); | ||
snprintf(fname, 256, "%s/norns/matronrc.lua", home); | ||
} | ||
fprintf(stderr, "loading matronrc file: %s\n", fname); | ||
if (l_dofile(l, fname)) { | ||
fprintf(stderr, "error evaluating matronrc.lua, stop.\n"); | ||
return -1; | ||
} | ||
|
||
lua_close(l); | ||
|
||
io_setup_all(); | ||
screen_init(); | ||
|
||
return 0; | ||
} | ||
|
||
void config_deinit(void) { | ||
io_destroy_all(); | ||
} | ||
|
||
int _add_io(lua_State *l) { | ||
lua_check_num_args(2); | ||
const char *type = luaL_checkstring(l, 1); | ||
luaL_checktype(l, 2, LUA_TTABLE); | ||
|
||
io_ops_t **ops = io_types; | ||
while (*ops != NULL) { | ||
if (strcmp(type, (*ops)->name) == 0) { | ||
return io_create(l, *ops); | ||
} | ||
ops++; | ||
} | ||
|
||
fprintf(stderr, "ERROR (config) unknown io type: %s\n", type); | ||
lua_settop(l, 0); | ||
return luaL_error(l, "unknown input type"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#pragma once | ||
|
||
extern int config_init(void); | ||
extern void config_deinit(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
|
||
#include <stdint.h> | ||
|
||
|
||
|
||
typedef enum { | ||
// libmonome devices | ||
DEV_TYPE_MONOME = 0, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.