Skip to content

Commit 3227c65

Browse files
committed
Merge branch 'enable-uart'.
This is posted as ninjablocks#10.
2 parents f13509e + 4a896aa commit 3227c65

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

init/arduino-uart-enable.conf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
description "Ensure needed UARTs are enabled"
2+
author "Hilmar Lapp <hlapp@drycafe.net>"
3+
4+
start on filesystem and runlevel [2345]
5+
6+
task
7+
8+
script
9+
if [ -z "$ARDUINO_UART" ] ; then
10+
ARDUINO_UART=1
11+
fi
12+
if [ ! -c /dev/ttyO$ARDUINO_UART ] ; then
13+
. /etc/default/rcS
14+
. /etc/environment.local
15+
if [ "$NINJA_HARDWARE_TYPE" = "BBB" ]; then
16+
capemgr=/sys/devices/bone_capemgr.9
17+
if [ ! -d $capemgr ] ; then
18+
capemgr=/sys/devices/platform/bone_capemgr
19+
fi
20+
/bin/echo BB-UART$ARDUINO_UART > $capemgr/slots
21+
fi
22+
fi
23+
end script
24+
25+
pre-start script
26+
if [ -f /etc/environment.local ]; then
27+
. /etc/environment.local
28+
fi
29+
if [ -z "$NINJA_HARDWARE_TYPE" ]; then
30+
/opt/utilities/bin/detect-hw-os
31+
. /etc/environment.local
32+
fi
33+
end script

0 commit comments

Comments
 (0)