Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thirdegg committed Mar 19, 2024
1 parent d79b94a commit 61d95ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 32 deletions.
21 changes: 3 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ OBJ = src/main.o src/serial.o src/slip.o src/command.o src/render.o src/ini.o sr
DEPS = src/serial.h src/slip.h src/command.h src/render.h src/ini.h src/config.h src/input.h src/fx_cube.h src/audio.h src/ringbuffer.h src/inline_font.h src/SDL2_compat.h

#Any special libraries you are using in your project (e.g. -lbcm2835 -lrt `pkg-config --libs gtk+-3.0` ), or leave blank
#INCLUDES = -L./lib -l:ld-linux-armhf.so.3 -l:libc.so.6 -l:libm.so.6 -l:libSDL2-2.0.so.0 -l:libvorbisfile.so.3 -l:libvorbis.so.0 -l:libogg.so.0 -l:libpng16.so.16 -l:libz.so.1 -l:libserialport.so
INCLUDES = -L/root/workspace/libusb/libusb/.libs -L/root/workspace/m8c-sdl_1/deps/SDL_gfx-2.0.27/.libs -lSDL_gfx -lusb-1.0 -lSDL
INCLUDES = -L/root/workspace/m8c-rg35xx/deps/libusb/libusb/.libs -L/root/workspace/m8c-rg35xx/deps/SDL_gfx.libs -lSDL_gfx -lusb-1.0 -lSDL

#Set any compiler flags you want to use (e.g. -I/usr/include/somefolder `pkg-config --cflags gtk+-3.0` ), or leave blank
#local_CFLAGS = -nolibc -D_REENTRANT -Wl,-rpath=lib/ -Wl,--dynamic-linker=lib/ld-linux-armhf.so.3 -Wall -O2 -pipe -I. -I/opt/rg35xx/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/local/include/SDL2 -I/opt/rg35xx/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/local/include/directfb -I/opt/rg35xx/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/local/include -DDEBUG_MSG=1
local_CFLAGS = -Wall -O2 -pipe -I. -I/root/workspace/libusb/libusb/ -I/root/workspace/m8c-sdl_1/deps/SDL_gfx-2.0.27 $(shell pkg-config --cflags sdl) -DUSE_LIBUSB=1 -DDEBUG_MSG=1
local_CFLAGS = -Wall -O2 -pipe -I. -I/root/workspace/m8c-rg35xx/deps/libusb/libusb/ -I/root/workspace/m8c-rg35xx/deps/SDL_gfx $(shell pkg-config --cflags sdl) -DUSE_LIBUSB=1 -DDEBUG_MSG=1

#Set the compiler you are using ( gcc for C or g++ for C++ )
#CC = arm-buildroot-linux-gnueabihf-gcc
Expand All @@ -30,21 +28,8 @@ SOURCE_DIR = src/
m8c: $(OBJ)
$(CC) -o $@ $^ $(local_CFLAGS) $(INCLUDES)

libusb: INCLUDES = $(shell pkg-config --libs sdl libusb-1.0)
libusb: local_CFLAGS = $(CFLAGS) $(shell pkg-config --cflags sdl libusb-1.0) -Wall -O2 -pipe -I. -DUSE_LIBUSB=1
libusb: m8c

#Cleanup
.PHONY: clean

clean:
rm -f src/*.o *~ m8c

# PREFIX is environment variable, but if it is not set, then set default value
ifeq ($(PREFIX),)
PREFIX := /usr/local
endif

install: m8c
install -d $(DESTDIR)$(PREFIX)/bin/
install -m 755 m8c $(DESTDIR)$(PREFIX)/bin/
rm -f src/*.o *~ m8c
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ All interaction occurs through `libusb`, M8 command reception has been rewritten
git clone git@github.com:edemirkan/rg35xx-toolchain.git toolchain
cd toolchain

# Run container with toolchain
# Clone project with deps
mkdir workspace
make shell
git clone git@github.com:thirdegg/m8c-rg35xx workspace/m8c-rg35xx
git clone git@github.com:ferzkopp/SDL_gfx.git workspace/m8c-rg35xx/deps/SDL_gfx
git clone git@github.com:libusb/libusb.git workspace/m8c-rg35xx/deps/libusb

# Clone project
git clone git@github.com:thirdegg/m8c-rg35xx m8c-rg35xx
cd m8c-rg35xx
# Run container with toolchain
make shell

# Clone and build SDL_gfx
git clone git@github.com:ferzkopp/SDL_gfx.git deps/SDL_gfx
cd deps/SDL_gfx
# Build SDL_gfx
cd m8c-rg35xx/deps/SDL_gfx
./configure --host=arm-linux --enable-mmx=no --enable-shared=no
make
cd -

# Clone and build libusb
git clone git@github.com:libusb/libusb.git deps/libusb
cd deps/libusb
./configure --host=arm-linux
# Build libusb
cd m8c-rg35xx/deps/libusb
apt install -y libtool
./autogen.sh --host arm-linux --enable-udev=no --enable-shared=no
make
cd -

Expand All @@ -47,7 +47,7 @@ exit
## Running

1) Create a folder named `m8c/` on the flash drive in `Roms/APPS/`.
2) Copy the executable file `m8c` from the `workspace/` folder into it.
2) Copy the executable file `m8c` from the `toolchain/workspace/m8c-rg35xx` folder into it.
3) Create a file `m8c.sh` in the `Roms/APPS/` folder with the following contents:
```sh
#!/bin/sh
Expand Down
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ config_params_s init_config() {
c.wait_for_device = 1; // default to exit if device disconnected
c.wait_packets = 1024; // default zero-byte attempts to disconnect (about 2
// sec for default idle_ms)
c.audio_enabled = 0; // route M8 audio to default output
c.audio_enabled = 1; // route M8 audio to default output
c.audio_buffer_size = 1024; // requested audio buffer size in samples
c.audio_device_name = NULL; // Use this device, leave NULL to use the default output device

Expand Down

0 comments on commit 61d95ad

Please sign in to comment.