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

Commit 08655bb

Browse files
committed
Merge branch 'master' into add_x11
2 parents 4ce19c2 + e25fabd commit 08655bb

Some content is hidden

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

46 files changed

+2407
-157
lines changed

CMakeLists.txt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
1313
option(ENABLE_SPIDEV "Enable the SPIDEV device" ON)
1414
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
1515

16+
option(ENABLE_WS2812BPWM "Enable the WS2812b-PWM device" OFF)
17+
message(STATUS "ENABLE_WS2812BPWM = " ${ENABLE_WS2812BPWM})
18+
1619
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
1720
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
1821

@@ -22,6 +25,13 @@ message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
2225
option(ENABLE_TINKERFORGE "Enable the TINKERFORGE device" ON)
2326
message(STATUS "ENABLE_TINKERFORGE = " ${ENABLE_TINKERFORGE})
2427

28+
option(ENABLE_PROTOBUF "Enable PROTOBUF server" ON)
29+
message(STATUS "ENABLE_PROTOBUF = " ${ENABLE_PROTOBUF})
30+
31+
if(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
32+
message(FATAL_ERROR "V4L2 grabber requires PROTOBUF. Disable V4L2 or enable PROTOBUF")
33+
endif(ENABLE_V4L2 AND NOT ENABLE_PROTOBUF)
34+
2535
# Createt the configuration file
2636
# configure a header file to pass some of the CMake settings
2737
# to the source code
@@ -57,12 +67,14 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
5767
# Configure the use of QT4
5868
find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
5969

60-
# add protocol buffers (make sure to find the static version)
61-
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
62-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
63-
find_package(Protobuf REQUIRED)
64-
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
65-
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
70+
if (ENABLE_PROTOBUF)
71+
# add protocol buffers (make sure to find the static version)
72+
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
73+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
74+
find_package(Protobuf REQUIRED)
75+
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
76+
set(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
77+
endif (ENABLE_PROTOBUF)
6678

6779
#add libusb and pthreads
6880
find_package(libusb-1.0 REQUIRED)

HyperionConfig.h.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99
// Define to enable the spi-device
1010
#cmakedefine ENABLE_SPIDEV
1111

12+
// Define to enable the ws2812b-pwm-device
13+
#cmakedefine ENABLE_WS2812BPWM
14+
1215
// Define to enable the spi-device
1316
#cmakedefine ENABLE_TINKERFORGE
17+
18+
// Define to enable PROTOBUF server
19+
#cmakedefine ENABLE_PROTOBUF

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'

cmake/Findlibusb-1.0.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
8787
message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
8888
endif (NOT libusb_1_FIND_QUIETLY)
8989
else (LIBUSB_1_FOUND)
90+
unset(LIBUSB_1_LIBRARY CACHE)
9091
if (libusb_1_FIND_REQUIRED)
9192
message(FATAL_ERROR "Could not find libusb")
9293
endif (libusb_1_FIND_REQUIRED)

cmake/qt4/Qt4ConfigDependentSettings.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ if(Q_WS_X11)
270270

271271
endif()
272272

273+
if(Q_WS_QWS)
274+
set(CMAKE_THREAD_PREFER_PTHREADS 1)
275+
find_package(Threads)
276+
if(CMAKE_USE_PTHREADS_INIT)
277+
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
278+
endif()
279+
280+
set (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
281+
282+
endif()
273283

274284
if(Q_WS_WIN)
275285
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)

config/hyperion.config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@
8080
{
8181
"type" : "none",
8282
"time_ms" : 200,
83-
"updateFrequency" : 20.0000
83+
"updateFrequency" : 20.0000,
84+
"updateDelay" : 0
8485
}
8586
},
8687

deploy/hummingboard_prerelease.tar.gz

690 KB
Binary file not shown.

deploy/hyperion.tar.gz

30.8 KB
Binary file not shown.

effects/knight-rider.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"args" :
55
{
66
"speed" : 1.0,
7-
"fadeFactor" : 0.7
7+
"fadeFactor" : 0.7,
8+
"color" : [255,0,0]
89
}
910
}

effects/knight-rider.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import time
33
import colorsys
44

5-
# Get the rotation time
5+
# Get the parameters
66
speed = float(hyperion.args.get('speed', 1.0))
77
fadeFactor = float(hyperion.args.get('fadeFactor', 0.7))
8+
color = hyperion.args.get('color', (255,0,0))
89

910
# Check parameters
1011
speed = max(0.0001, speed)
@@ -13,7 +14,9 @@
1314
# Initialize the led data
1415
width = 25
1516
imageData = bytearray(width * (0,0,0))
16-
imageData[0] = 255
17+
imageData[0] = color[0]
18+
imageData[1] = color[1]
19+
imageData[2] = color[2]
1720

1821
# Calculate the sleep time and rotation increment
1922
increment = 1
@@ -41,9 +44,13 @@
4144
# Fade the old data
4245
for j in range(width):
4346
imageData[3*j] = int(fadeFactor * imageData[3*j])
47+
imageData[3*j+1] = int(fadeFactor * imageData[3*j+1])
48+
imageData[3*j+2] = int(fadeFactor * imageData[3*j+2])
4449

4550
# Insert new data
46-
imageData[3*position] = 255
51+
imageData[3*position] = color[0]
52+
imageData[3*position+1] = color[1]
53+
imageData[3*position+2] = color[2]
4754

4855
# Sleep for a while
4956
time.sleep(sleepTime)

0 commit comments

Comments
 (0)