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

Commit 4ce19c2

Browse files
committed
Merge branch 'master' into add_x11
2 parents c28e098 + ad35436 commit 4ce19c2

File tree

78 files changed

+5052
-1947
lines changed

Some content is hidden

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

78 files changed

+5052
-1947
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: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
1919
option(ENABLE_X11 "Enable the X11 grabber" ON)
2020
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
2121

22+
option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ON)
23+
message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE})
24+
2225
# Createt the configuration file
2326
# configure a header file to pass some of the CMake settings
2427
# to the source code
25-
configure_file ("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
28+
configure_file("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
2629
include_directories("${PROJECT_BINARY_DIR}")
2730

2831
# Add project specific cmake modules (find, etc)
@@ -65,6 +68,10 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
6568
find_package(libusb-1.0 REQUIRED)
6669
find_package(Threads REQUIRED)
6770

71+
if (ENABLE_TINKERFORGE)
72+
#find_package(libtinkerforge-1.0 REQUIRED)
73+
endif (ENABLE_TINKERFORGE)
74+
6875
include(${QT_USE_FILE})
6976
add_definitions(${QT_DEFINITIONS})
7077
# TODO[TvdZ]: This linking directory should only be added if we are cross compiling

CompileHowto.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ cd "$HYPERION_DIR/build"
1919

2020
# run cmake to generate make files on the rsapberry pi
2121
cmake ..
22-
# or if you are not compiling on the raspberry pi and need to disable the Disppmanx grabber
23-
cmake -DENABLE_DISPMANX=OFF ..
22+
# or if you are not compiling on the raspberry pi and need to disable the Dispmanx grabber and support for spi devices
23+
cmake -DENABLE_DISPMANX=OFF -DENABLE_SPIDEV=OFF ..
2424

2525
# run make to build Hyperion
2626
make

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

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)