Skip to content

Commit

Permalink
using multiple pru files (stored in pru/, built in build/pru/)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Dec 20, 2017
1 parent 323250d commit 48b26e3
Show file tree
Hide file tree
Showing 6 changed files with 1,872 additions and 9 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif # ifndef PROJECT
COMMAND_LINE_OPTIONS := --pru-file $(BELA_DIR)/pru_rtaudio.bin $(COMMAND_LINE_OPTIONS)
run: pru_rtaudio.bin
else
build/core/PRU.o: include/pru_rtaudio_bin.h
build/core/PruBinary.o: build/pru/pru_rtaudio_bin.h build/pru/pru_rtaudio_irq_bin.h
endif #ifeq($(RUN_WITH_PRU_BIN),true)

ifdef PROJECT
Expand Down Expand Up @@ -139,7 +139,7 @@ endif

ifeq ($(SHOULD_BUILD),true)
#create build directories
$(shell mkdir -p $(PROJECT_DIR)/build build/core )
$(shell mkdir -p $(PROJECT_DIR)/build build/core build/pru )
endif

endif # ifdef PROJECT
Expand Down Expand Up @@ -259,7 +259,7 @@ ifeq ($(PROJECT_TYPE),libpd)
LIBS += $(LIBPD_LIBS)
endif

INCLUDES := -I$(PROJECT_DIR) -I./include -I/usr/include/
INCLUDES := -I$(PROJECT_DIR) -I./include -I/usr/include/ -I./build/pru/
ifeq ($(XENOMAI_VERSION),2.6)
BELA_USE_DEFINE=BELA_USE_POLL
endif
Expand Down Expand Up @@ -398,16 +398,16 @@ build/core/%.o: ./core/%.S
$(AT) echo ' ...done'
$(AT) echo ' '

pru_rtaudio.bin: pru_rtaudio.p
%.bin: pru/%.p
$(AT) echo 'Building $<...'
$(AT) pasm -V2 -b pru_rtaudio.p > /dev/null
$(AT) pasm -V2 -b "$<" > /dev/null
$(AT) echo ' ...done'
$(AT) echo ' '

include/pru_rtaudio_bin.h: pru_rtaudio.p
build/pru/%_bin.h: pru/%.p
$(AT) echo 'Building $<...'
$(AT) pasm -V2 -L -c pru_rtaudio.p > /dev/null
$(AT) mv pru_rtaudio_bin.h include/
$(AT) pasm -V2 -L -c "$<" > /dev/null
$(AT) mv "$(@:build/pru/%=%)" build/pru/
$(AT) echo ' ...done'
$(AT) echo ' '

Expand Down
23 changes: 23 additions & 0 deletions core/PruBinary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "../include/PruBinary.h"

// the files included below are generated in build/pru/ from the files in pru/
// according to the rules defined in the Makefile

namespace NonIrqPruCode
{
#include "pru_rtaudio_bin.h"
const unsigned int* getBinary()
{
return PRUcode;
}
};

namespace IrqPruCode
{
#include "pru_rtaudio_irq_bin.h"
const unsigned int* getBinary()
{
return PRUcode;
}
};

10 changes: 10 additions & 0 deletions include/PruBinary.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace NonIrqPruCode
{
const unsigned int* getBinary();
}

namespace IrqPruCode
{
const unsigned int* getBinary();
}

File renamed without changes.
Loading

0 comments on commit 48b26e3

Please sign in to comment.