Skip to content

Commit

Permalink
Merge branch 'bela/xenomai-3' into bela/releases
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Oct 11, 2017
2 parents ce7faff + adc763c commit a385647
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 144 deletions.
23 changes: 18 additions & 5 deletions README_BELA.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
This code will build on Bela image 3.0 and above (requires libbela and xenomai 3).
======================================

See [SuperCollider-on-Bela](https://github.com/BelaPlatform/Bela/wiki/SuperCollider-on-Bela) for general information on SuperCollider on Bela.

Compiling SuperCollider scsynth on Bela
Expand All @@ -11,9 +14,9 @@ This branch contains that plus other modifications to get the SC source code mas

The main addition in this branch is a **Xenomai/Bela audio driver for scsynth**, to use Bela's ultra-low-latency audio thread *instead* of jack/portaudio, and **plugins to access the analog and digital channels of the Bela-cape**

> *NOTE:* This guide assumes you have the [Bela image v0.2.0b](https://github.com/BelaPlatform/bela-image/releases/tag/v0.2.0b).
> *NOTE:* This guide assumes you have the [Bela image v0.2.0b](https://github.com/BelaPlatform/bela-image/releases/tag/v0.2.0b) or later. Where differences arise between versions below, you will see a note with "vX.X.X"
> *NOTE:* You need to update the Bela code in `/root/Bela` to [Bela dev-lib](https://github.com/BelaPlatform/Bela/tree/dev-libbela) branch for this version to compile.
> *NOTE:* You need to get the latest version of the Bela code in order for Supercollider to compile.
All of the commands here are to be executed *on the Bela device itself*. Normally you would SSH to it from a computer connected by USB, in order to do the following stuff.

Expand Down Expand Up @@ -57,11 +60,15 @@ My modified source code is in this git branch here. If your Bela is still connec
Compiling and installing
========================

You will need to connect your board to the internet in order to install the pre-requisites.

Update apt source list:

apt-get update


### On Bela image v0.2.x(Debian Wheezy):

We need gcc-4.8 / g++-4.8 as 4.9 causes a weird bug (https://github.com/supercollider/supercollider/issues/1450):

apt-get install -t jessie gcc-4.8 g++-4.8
Expand All @@ -74,6 +81,12 @@ Get dependent libraries:

apt-get install -t jessie libudev-dev

### On Bela image v0.3.x(Debian Stretch):

We need a couple of libraries:

apt-get install libxt-dev libx11-dev libudev-dev

Before we compile, here are two optional steps to make your workflow faster

1. installing `ccache` makes repeated builds faster, if you have spare disk space for it. It's especially helpful if you're going to be changing the cmake build scripts.
Expand Down Expand Up @@ -106,13 +119,13 @@ Then here's how to build:
cd /extrabela/build

# here's the command WITHOUT ccache
cmake /extrabela/supercollider -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8 -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DNATIVE=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela
cmake /extrabela/supercollider -DCMAKE_C_COMPILER=gcc-4.8 -DCMAKE_CXX_COMPILER=g++-4.8 -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSC_HIDAPI=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DNATIVE=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela

# or here's the command WITH ccache
cmake /extrabela/supercollider -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc-4.8 -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++-4.8 -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DNATIVE=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela
cmake /extrabela/supercollider -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc-4.8 -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++-4.8 -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSC_HIDAPI=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DNATIVE=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela

# or here's the command WITH distcc (it will infer the compilers from the `export CC CXX` above
cmake /extrabela/supercollider -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela
cmake /extrabela/supercollider -DNOVA_SIMD=ON -DSSE=OFF -DSSE2=OFF -DINSTALL_HELP=OFF -DSC_QT=OFF -DSC_IDE=OFF -DSC_EL=OFF -DSC_ED=OFF -DSC_VIM=OFF -DSC_HIDAPI=OFF -DSUPERNOVA=OFF -DNO_AVAHI=ON -DENABLE_TESTSUITE=OFF -DAUDIOAPI=bela
make

The `make` step will take a little while, about 30 minutes when using plain `gcc` or `ccache` (you can try `make -j2` or `make -j3` with `distcc`), more like 10 minutes when using `distcc`. It seems it is stuck for a long time at compiling the BinaryOpUGens, but it will get past that.
Expand Down
91 changes: 34 additions & 57 deletions cmake_modules/FindBela.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,78 +15,55 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

if (BELA_INCLUDE_DIRS)
if (BELA_CFLAGS AND BELA_CXXFLAGS AND BELA_LDFLAGS)
# in cache already
set(BELA_FOUND TRUE)
else (BELA_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(xenomai _BELA_INCLUDEDIR _BELA_LIBDIR _BELA_LDFLAGS _BELA_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_BELA xenomai)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(BELA_INCLUDE_DIR
else (BELA_CFLAGS AND BELA_CXXFLAGS AND BELA_LDFLAGS)
# Bela comes with its own ...-config program to get configuration flags
find_program(BELA_CONFIG
NAMES
Bela.h
bela-config
PATHS
${_BELA_INCLUDEDIR}
/root/Bela/include
/usr/include
/usr/local/include
/opt/local/include
/sw/include
/root/Bela/resources/bin
$ENV{BELA_ROOT}/resources/bin
/usr/local/bin
/usr/bin
)
message("Searching for BELA man: config ${BELA_CONFIG}")

find_path(BELA_SOURCES_DIR
NAMES
RTAudio.cpp
PATHS
${_BELA_SOURCES_DIR}
/root/Bela/core
)

file(GLOB BELA_SOURCE_FILES ${BELA_SOURCES_DIR}/*.c ${BELA_SOURCES_DIR}/*.cpp)
if (BELA_CONFIG)
execute_process(COMMAND ${BELA_CONFIG} --defines OUTPUT_VARIABLE BELA_DEFINITIONS)
string(STRIP "${BELA_DEFINITIONS}" BELA_DEFINITIONS)
execute_process(COMMAND ${BELA_CONFIG} --includes OUTPUT_VARIABLE BELA_INCLUDE_DIRS)
string(STRIP "${BELA_INCLUDE_DIRS}" BELA_INCLUDE_DIRS)
execute_process(COMMAND ${BELA_CONFIG} --libraries OUTPUT_VARIABLE BELA_LIBRARIES)
string(STRIP "${BELA_LIBRARIES}" BELA_LIBRARIES)
execute_process(COMMAND ${BELA_CONFIG} --cflags OUTPUT_VARIABLE BELA_C_FLAGS)
string(STRIP "${BELA_C_FLAGS}" BELA_C_FLAGS)
execute_process(COMMAND ${BELA_CONFIG} --cxxflags OUTPUT_VARIABLE BELA_CXX_FLAGS)
string(STRIP "${BELA_CXX_FLAGS}" BELA_CXX_FLAGS)
endif (BELA_CONFIG)

if (BELA_INCLUDE_DIR)
if (BELA_CONFIG)
set(BELA_FOUND TRUE)
endif (BELA_INCLUDE_DIR)

set(BELA_INCLUDE_DIRS
${BELA_INCLUDE_DIR}
)

set(BELA_SOURCES
${BELA_SOURCE_FILES}
)
list(REMOVE_ITEM BELA_SOURCES ${BELA_SOURCES_DIR}/default_libpd_render.cpp)
list(REMOVE_ITEM BELA_SOURCES ${BELA_SOURCES_DIR}/default_main.cpp)

set(BELA_LIBRARIES
"-L/usr/xenomai/lib -L/usr/lib/arm-linux-gnueabihf -lrt -lnative -lxenomai -lprussdrv -lpthread_rt" # TODO is this the best portable way to link these?
)

if (BELA_INCLUDE_DIRS)
set(BELA_FOUND TRUE)
endif (BELA_INCLUDE_DIRS)
endif (BELA_CONFIG)

if (BELA_FOUND)
if (NOT BELA_FIND_QUIETLY)
message(STATUS "Found Bela headers: ${BELA_INCLUDE_DIRS}")
message(STATUS "Found Bela sources: ${BELA_SOURCES}")
execute_process(COMMAND ${BELA_CONFIG} --prefix OUTPUT_VARIABLE BELA_PREFIX)
message(STATUS "Found Bela: ${BELA_PREFIX}")
message(STATUS "BELA_DEFINITIONS: ${BELA_DEFINITIONS}")
message(STATUS "BELA_INCLUDE_DIRS: ${BELA_INCLUDE_DIRS}")
message(STATUS "BELA_LIBRARIES: ${BELA_LIBRARIES}")
message(STATUS "BELA_C_FLAGS: ${BELA_C_FLAGS}")
message(STATUS "BELA_CXX_FLAGS: ${BELA_CXX_FLAGS}")
endif (NOT BELA_FIND_QUIETLY)
else (BELA_FOUND)
if (BELA_FIND_REQUIRED)
message(FATAL_ERROR "Could not find BELA")
endif (BELA_FIND_REQUIRED)
endif (BELA_FOUND)
# show the BELA_ variables only in the advanced view
mark_as_advanced(BELA_CFLAGS BELA_CXXFLAGS BELA_LDFLAGS)

# show the BELA_INCLUDE_DIRS variables only in the advanced view
mark_as_advanced(BELA_INCLUDE_DIRS)

endif (BELA_INCLUDE_DIRS)

endif (BELA_CFLAGS AND BELA_CXXFLAGS AND BELA_LDFLAGS)
165 changes: 111 additions & 54 deletions cmake_modules/FindXenomai.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,77 +14,134 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#

if (XENOMAI_LIBRARIES AND XENOMAI_INCLUDE_DIRS)
# https://cmake.org/Wiki/CMakeMacroParseArguments

MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)

SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)

# LIST_FILTER(<list> <regexp_var> [<regexp_var> ...]
# [OUTPUT_VARIABLE <variable>])
# Removes items from <list> which do not match any of the specified
# regular expressions. An optional argument OUTPUT_VARIABLE
# specifies a variable in which to store the matched items instead of
# updating <list>
# As regular expressions can not be given to macros (see bug #5389), we pass
# variable names whose content is the regular expressions.
# Note that this macro requires PARSE_ARGUMENTS macro, available here:
# http://www.cmake.org/Wiki/CMakeMacroParseArguments
MACRO(LIST_FILTER)
PARSE_ARGUMENTS(LIST_FILTER "OUTPUT_VARIABLE" "" ${ARGV})
# Check arguments.
LIST(LENGTH LIST_FILTER_DEFAULT_ARGS LIST_FILTER_default_length)
IF(${LIST_FILTER_default_length} EQUAL 0)
MESSAGE(FATAL_ERROR "LIST_FILTER: missing list variable.")
ENDIF(${LIST_FILTER_default_length} EQUAL 0)
IF(${LIST_FILTER_default_length} EQUAL 1)
MESSAGE(FATAL_ERROR "LIST_FILTER: missing regular expression variable.")
ENDIF(${LIST_FILTER_default_length} EQUAL 1)
# Reset output variable
IF(NOT LIST_FILTER_OUTPUT_VARIABLE)
SET(LIST_FILTER_OUTPUT_VARIABLE "LIST_FILTER_internal_output")
ENDIF(NOT LIST_FILTER_OUTPUT_VARIABLE)
SET(${LIST_FILTER_OUTPUT_VARIABLE})
# Extract input list from arguments
LIST(GET LIST_FILTER_DEFAULT_ARGS 0 LIST_FILTER_input_list)
LIST(REMOVE_AT LIST_FILTER_DEFAULT_ARGS 0)
FOREACH(LIST_FILTER_item ${${LIST_FILTER_input_list}})
FOREACH(LIST_FILTER_regexp_var ${LIST_FILTER_DEFAULT_ARGS})
FOREACH(LIST_FILTER_regexp ${${LIST_FILTER_regexp_var}})
IF(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
LIST(APPEND ${LIST_FILTER_OUTPUT_VARIABLE} ${LIST_FILTER_item})
ENDIF(${LIST_FILTER_item} MATCHES ${LIST_FILTER_regexp})
ENDFOREACH(LIST_FILTER_regexp ${${LIST_FILTER_regexp_var}})
ENDFOREACH(LIST_FILTER_regexp_var)
ENDFOREACH(LIST_FILTER_item)
# If OUTPUT_VARIABLE is not specified, overwrite the input list.
IF(${LIST_FILTER_OUTPUT_VARIABLE} STREQUAL "LIST_FILTER_internal_output")
SET(${LIST_FILTER_input_list} ${${LIST_FILTER_OUTPUT_VARIABLE}})
ENDIF(${LIST_FILTER_OUTPUT_VARIABLE} STREQUAL "LIST_FILTER_internal_output")
ENDMACRO(LIST_FILTER)


if (XENOMAI_LIRARIES AND XENOMAI_INCLUDE_DIRS AND XENOMAI_DEFINITIONS)
# in cache already
set(XENOMAI_FOUND TRUE)
else (XENOMAI_LIBRARIES AND XENOMAI_INCLUDE_DIRS)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(xenomai _XENOMAI_INCLUDEDIR _XENOMAI_LIBDIR _XENOMAI_LDFLAGS _XENOMAI_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(_XENOMAI xenomai)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(XENOMAI_INCLUDE_DIR
else (XENOMAI_LIRARIES AND XENOMAI_INCLUDE_DIRS AND XENOMAI_DEFINITIONS)
# Xenomai comes with its own ...-config program to get cflags and ldflags
find_program(XENOMAI_XENO_CONFIG
NAMES
xeno_config.h
xeno-config
PATHS
${_XENOMAI_INCLUDEDIR}
/usr/xenomai/include
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)

find_library(XENOMAI_LIBRARY
NAMES
xenomai
PATHS
${_XENOMAI_LIBDIR}
/usr/xenomai/lib
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
/usr/xenomai/bin
/usr/local/bin
/usr/bin
)

if (XENOMAI_LIBRARY)
if (XENOMAI_XENO_CONFIG)
set(XENOMAI_FOUND TRUE)
SET(XENOMAI_DEFINITIONS "${XENOMAI_DEFINITIONS} -lnative -lxenomai -lrt -lpthread_rt" )
endif (XENOMAI_LIBRARY)
execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --skin=posix --cflags OUTPUT_VARIABLE XENOMAI_CFLAGS)
string(STRIP "${XENOMAI_CFLAGS}" XENOMAI_CFLAGS)
# use grep to separate out defines and includes
execute_process(
COMMAND bash -c "A= ; for a in ${XENOMAI_CFLAGS}; do echo $a | grep -q \"\\-D.*\" && A=\"$A $a\"; done; echo $A"
OUTPUT_VARIABLE XENOMAI_DEFINITIONS)
string(STRIP "${XENOMAI_DEFINITIONS}" XENOMAI_DEFINITIONS)

set(XENOMAI_INCLUDE_DIRS
${XENOMAI_INCLUDE_DIR}
)
execute_process(
COMMAND bash -c "A= ; for a in ${XENOMAI_CFLAGS}; do echo $a | grep -q \"\\-I.*\" && A=\"$A `echo $a|sed s/-I//`;\"; done; echo $A"
OUTPUT_VARIABLE XENOMAI_INCLUDE_DIRS)
string(STRIP "${XENOMAI_INCLUDE_DIRS}" XENOMAI_INCLUDE_DIRS)

if (XENOMAI_FOUND)
set(XENOMAI_LIBRARIES
${XENOMAI_LIBRARIES}
${XENOMAI_LIBRARY}
)
endif (XENOMAI_FOUND)

if (XENOMAI_INCLUDE_DIRS AND XENOMAI_LIBRARIES)
set(XENOMAI_FOUND TRUE)
endif (XENOMAI_INCLUDE_DIRS AND XENOMAI_LIBRARIES)
execute_process(
COMMAND ${XENOMAI_XENO_CONFIG} --skin=posix --ldflags --no-auto-init
COMMAND sed "s/-Wl,@.*wrappers//g"
OUTPUT_VARIABLE XENOMAI_LIBRARIES)
string(STRIP "${XENOMAI_LIBRARIES}" XENOMAI_LIBRARIES)
endif (XENOMAI_XENO_CONFIG)

if (XENOMAI_FOUND)
if (NOT XENOMAI_FIND_QUIETLY)
message(STATUS "Found xenomai: ${XENOMAI_LIBRARY}")
execute_process(COMMAND ${XENOMAI_XENO_CONFIG} --prefix OUTPUT_VARIABLE XENOMAI_PREFIX)
message(STATUS "Found xenomai: ${XENOMAI_PREFIX}")
message(STATUS "XENOMAI_LIBRARIES: ${XENOMAI_LIBRARIES}")
message(STATUS "XENOMAI_INCLUDE_DIRS: ${XENOMAI_INCLUDE_DIRS}")
message(STATUS "XENOMAI_DEFINITIONS: ${XENOMAI_DEFINITIONS}")
endif (NOT XENOMAI_FIND_QUIETLY)
else (XENOMAI_FOUND)
if (XENOMAI_FIND_REQUIRED)
message(FATAL_ERROR "Could not find XENOMAI")
endif (XENOMAI_FIND_REQUIRED)
endif (XENOMAI_FOUND)
# show the XENOMAI_ variables only in the advanced view
mark_as_advanced(XENOMAI_LIRARIES XENOMAI_INCLUDE_DIRS XENOMAI_DEFINITIONS)

# show the XENOMAI_INCLUDE_DIRS and XENOMAI_LIBRARIES variables only in the advanced view
mark_as_advanced(XENOMAI_INCLUDE_DIRS XENOMAI_LIBRARIES)

endif (XENOMAI_LIBRARIES AND XENOMAI_INCLUDE_DIRS)

endif (XENOMAI_LIRARIES AND XENOMAI_INCLUDE_DIRS AND XENOMAI_DEFINITIONS)
17 changes: 7 additions & 10 deletions server/plugins/BELAUGens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@
#include <atomic>

#include "Bela.h"
// Xenomai-specific includes
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
#include <native/intr.h>
#include <rtdk.h>
// These functions are provided by xenomai
int rt_printf(const char *format, ...);
int rt_fprintf(FILE *stream, const char *format, ...);

#include "SC_PlugIn.h"

Expand Down Expand Up @@ -112,12 +109,12 @@ void MultiplexAnalogIn_next_aaa(MultiplexAnalogIn *unit, int inNumSamples)
// for(unsigned int n = 0; n < context->audioFrames; n++) {
for(unsigned int n = 0; n < inNumSamples; n++) {
analogPin = (int) fin[n];
muxChannel = (int) fmux[n];
muxChannel = (int) fmux[n];
if ( (analogPin < 0) || (analogPin >= context->analogInChannels) || (muxChannel < 0) || ( muxChannel > context->multiplexerChannels) ){
rt_printf( "MultiplexAnalogIn warning: analog pin must be between %i and %i, it is %i \n", 0, context->analogInChannels, analogPin );
rt_printf( "MultiplexAnalogIn warning: muxChannel must be between %i and %i, it is %i \n", 0, context->multiplexerChannels, muxChannel );
rt_printf( "MultiplexAnalogIn warning: analog pin must be between %i and %i, it is %i \n", 0, context->analogInChannels, analogPin );
rt_printf( "MultiplexAnalogIn warning: muxChannel must be between %i and %i, it is %i \n", 0, context->multiplexerChannels, muxChannel );
} else {
analogValue = multiplexerAnalogRead(context, analogPin, muxChannel); // is there something like NI? analogReadNI(context, 0, analogPin);
analogValue = multiplexerAnalogRead(context, analogPin, muxChannel); // is there something like NI? analogReadNI(context, 0, analogPin);
// if(analogPin == 0)
// {
// static int count = 0;
Expand Down
Loading

0 comments on commit a385647

Please sign in to comment.