Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit b4eb2e7

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents db0c38d + 00ccb7b commit b4eb2e7

File tree

94 files changed

+5821
-2022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+5821
-2022
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/*.user
22
/build
33
/build-x86
4+
.DS_Store
5+

CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,22 @@ cmake_minimum_required(VERSION 2.8)
77
#set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake)
88

99
# set the build options
10-
option (ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
11-
option (ENABLE_SPIDEV "Enable the SPIDEV device" ON)
12-
10+
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
1311
message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
14-
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
1512

16-
option (ENABLE_V4L2 "Enable the V4L2 grabber" ON)
13+
option(ENABLE_SPIDEV "Enable the SPIDEV device" ON)
14+
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
15+
16+
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
1717
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
1818

19+
option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ON)
20+
message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE})
21+
1922
# Createt the configuration file
2023
# configure a header file to pass some of the CMake settings
2124
# to the source code
22-
configure_file ("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
25+
configure_file("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
2326
include_directories("${PROJECT_BINARY_DIR}")
2427

2528
# Add project specific cmake modules (find, etc)
@@ -62,6 +65,10 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
6265
find_package(libusb-1.0 REQUIRED)
6366
find_package(Threads REQUIRED)
6467

68+
if (ENABLE_TINKERFORGE)
69+
#find_package(libtinkerforge-1.0 REQUIRED)
70+
endif (ENABLE_TINKERFORGE)
71+
6572
include(${QT_USE_FILE})
6673
add_definitions(${QT_DEFINITIONS})
6774
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling

HyperionConfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@
88

99
// Define to enable the spi-device
1010
#cmakedefine ENABLE_SPIDEV
11+
12+
// Define to enable the spi-device
13+
#cmakedefine ENABLE_TINKERFORGE

bin/hyperion.init.sh

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,27 @@ DAEMON=hyperiond
77
DAEMONOPTS="/etc/hyperion.config.json"
88
DAEMON_PATH="/usr/bin"
99

10-
NAME=$DEAMON
10+
NAME=$DAEMON
1111
DESC="Hyperion ambilight server"
1212
PIDFILE=/var/run/$NAME.pid
1313
SCRIPTNAME=/etc/init.d/$NAME
14-
1514
case "$1" in
1615
start)
17-
printf "%-50s" "Starting $NAME..."
18-
cd $DAEMON_PATH
19-
PID=`$DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo $!`
20-
#echo "Saving PID" $PID " to " $PIDFILE
21-
if [ -z $PID ]; then
22-
printf "%s\n" "Fail"
16+
if [ $(pgrep -l $NAME |wc -l) = 1 ]
17+
then
18+
printf "%-50s\n" "Already running..."
19+
exit 1
2320
else
24-
echo $PID > $PIDFILE
25-
printf "%s\n" "Ok"
21+
printf "%-50s" "Starting $NAME..."
22+
cd $DAEMON_PATH
23+
PID=`$DAEMON $DAEMONOPTS > /dev/null 2>&1 & echo $!`
24+
#echo "Saving PID" $PID " to " $PIDFILE
25+
if [ -z $PID ]; then
26+
printf "%s\n" "Fail"
27+
else
28+
echo $PID > $PIDFILE
29+
printf "%s\n" "Ok"
30+
fi
2631
fi
2732
;;
2833
status)
@@ -39,24 +44,31 @@ status)
3944
fi
4045
;;
4146
stop)
42-
printf "%-50s" "Stopping $NAME"
43-
PID=`cat $PIDFILE`
44-
cd $DAEMON_PATH
45-
if [ -f $PIDFILE ]; then
46-
kill -HUP $PID
47-
printf "%s\n" "Ok"
48-
rm -f $PIDFILE
47+
if [ -f $PIDFILE ]
48+
then
49+
printf "%-50s" "Stopping $NAME"
50+
PID=`cat $PIDFILE`
51+
cd $DAEMON_PATH
52+
if [ -f $PIDFILE ]; then
53+
kill -HUP $PID
54+
printf "%s\n" "Ok"
55+
rm -f $PIDFILE
56+
else
57+
printf "%s\n" "pidfile not found"
58+
fi
4959
else
50-
printf "%s\n" "pidfile not found"
60+
printf "%-50s\n" "No PID file $NAME not running?"
5161
fi
5262
;;
5363

5464
restart)
55-
$0 stop
56-
$0 start
65+
$0 stop
66+
$0 start
5767
;;
5868

5969
*)
6070
echo "Usage: $0 {status|start|stop|restart}"
6171
exit 1
6272
esac
73+
74+
exit 0

bin/install_hyperion.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ fi
3434
echo 'Downloading hyperion'
3535
if [ $IS_OPENELEC -eq 1 ]; then
3636
# OpenELEC has a readonly file system. Use alternative location
37-
curl --get https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz | tar -C /storage -xz
38-
curl --get https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.deps.openelec-rpi.tar.gz | tar -C /storage/hyperion/bin -xz
37+
curl -L --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz | tar -C /storage -xz
38+
curl -L --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.deps.openelec-rpi.tar.gz | tar -C /storage/hyperion/bin -xz
3939

4040
# modify the default config to have a correct effect path
4141
sed -i 's:/opt:/storage:g' /storage/hyperion/config/hyperion.config.json
4242
else
43-
wget https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz -O - | tar -C /opt -xz
43+
wget https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz -O - | tar -C /opt -xz
4444
fi
4545

4646
# create links to the binaries
@@ -68,9 +68,9 @@ fi
6868
if [ $USE_INITCTL -eq 1 ]; then
6969
echo 'Installing initctl script'
7070
if [ $IS_RASPBMC -eq 1 ]; then
71-
wget -N https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.conf -P /etc/init/
71+
wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.conf -P /etc/init/
7272
else
73-
wget -N https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.xbian.conf -O /etc/init/hyperion.conf
73+
wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.xbian.conf -O /etc/init/hyperion.conf
7474
fi
7575
elif [ $USE_SERVICE -eq 1 ]; then
7676
echo 'Installing startup script in init.d'

config/hyperion_x86.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{
1515
"name" : "MyPi",
1616
"type" : "adalight",
17-
"output" : "/dev/ttyUSB0",
17+
"output" : "/dev/ttyUSB0",
1818
"rate" : 115200,
1919
"colorOrder" : "rgb"
2020
},
@@ -363,7 +363,7 @@
363363
{
364364
"paths" :
365365
[
366-
"/opt/hyperion/effects"
366+
"/home/dincs/projects/hyperion/effects"
367367
]
368368
},
369369

dependencies/build/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
add_subdirectory(jsoncpp)
32
add_subdirectory(getoptPlusPlus)
4-
add_subdirectory(serial)
53
add_subdirectory(hidapi)
4+
add_subdirectory(jsoncpp)
5+
add_subdirectory(serial)
6+
add_subdirectory(tinkerforge)

dependencies/build/getoptPlusPlus/getoptpp.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ void PresettableUniquelySwitchable::preset() {
280280
template<>
281281
PODParameter<string>::PODParameter(char shortOption, const char *longOption,
282282
const char* description) : CommonParameter<PresettableUniquelySwitchable>(shortOption, longOption, description) {
283-
preset();
284283
}
285284

286285

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
project(tinkerforge)
2+
3+
# define the current source/header path
4+
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/dependencies/include/tinkerforge)
5+
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/dependencies/build/tinkerforge)
6+
7+
include_directories(${CURRENT_HEADER_DIR})
8+
9+
add_library(tinkerforge
10+
${CURRENT_HEADER_DIR}/bricklet_led_strip.h
11+
${CURRENT_HEADER_DIR}/ip_connection.h
12+
13+
${CURRENT_SOURCE_DIR}/bricklet_led_strip.c
14+
${CURRENT_SOURCE_DIR}/ip_connection.c)

0 commit comments

Comments
 (0)