Skip to content

Commit

Permalink
Miscellaneous.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Neill committed Sep 12, 2012
1 parent fee371e commit 86c31f6
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 38 deletions.
69 changes: 38 additions & 31 deletions Makefile
@@ -1,11 +1,21 @@
PREFIX = $(DESTDIR)/usr/local
BINDIR = $(PREFIX)/bin
DATAROOTDIR = $(PREFIX)/share
DOCDIR = $(DATAROOTDIR)/doc/pulseblaster
MANDIR = $(DATAROOTDIR)/man
MAN1DIR = $(MANDIR)/man1

all :: compile

compile:
cd kernel; make -C /lib/modules/`uname -r`/build M=`pwd` ; cd -
pod2man pbctl/pbctl -c "User Commands" > man/pbctl.1
bzip2 -kf man/pbctl.1
pod2man pb_ctl/pb_ctl -c "User Commands" > man/pb_ctl.1
bzip2 -kf man/pb_ctl.1
bzip2 -kf man/pb_driver-load.1
bzip2 -kf man/pb_test-flash-2Hz.1
ln -sf pb_test-flash-2Hz.1.bz2 man/pb_test-flash-fastest-5.55MHz.1.bz2
ln -sf pb_test-flash-2Hz.1.bz2 man/pb_test-identify-output.1.bz2
ln -sf pb_driver-load.1.bz2 man/pb_driver-unload.1.bz2

install:
@[ `whoami` = root ] || (echo "Error, please be root"; exit 1)
Expand All @@ -14,45 +24,42 @@ install:
cp kernel/pulseblaster.ko /lib/modules/`uname -r`/kernel/3rdparty/pulseblaster
gzip -f /lib/modules/`uname -r`/kernel/3rdparty/pulseblaster/pulseblaster.ko
depmod -A

@#PAM permissions.
echo '<console> 0660 /sys/class/pulseblaster/pulseblaster*/* 660 root.usb' > /etc/security/console.perms.d/90-pulseblaster.perms
@#Do it
modprobe pulseblaster; pam_console_apply
mkdir -p /usr/local/bin/
cp pbctl/pbctl /usr/local/bin/
cp pbctl/pb_driver-load.sh /usr/local/bin/pb_driver-load
cp pbctl/pb_driver-unload.sh /usr/local/bin/pb_driver-unload
cp pbctl/pb_test-flash-2Hz.sh /usr/local/bin/pb_test-flash-2Hz
cp pbctl/pb_test-flash-fastest-5.55MHz.sh /usr/local/bin/pb_test-flash-fastest-5.55MHz
cp pbctl/pb_test-identify-output.sh /usr/local/bin/pb_test-identify-output
mkdir -p /usr/local/share/doc/pulseblaster
cp doc/* README.txt LICENSE.txt /usr/local/share/doc/pulseblaster
mkdir -p /usr/local/man/man1
cp man/pbctl.1.bz2 /usr/local/man/man1
cp man/pb_test-flash-2Hz.1.bz2 /usr/local/man/man1
ln -sf /usr/local/man/man1/pb_test-flash-2Hz.1.bz2 /usr/local/man/man1/pb_test-flash-fastest-5.55MHz.1.bz2
ln -sf /usr/local/man/man1/pb_test-flash-2Hz.1.bz2 /usr/local/man/man1/pb_test-identify-output.1.bz2
cp man/pb_driver-load.1.bz2 /usr/local/man/man1
ln -sf /usr/local/man/man1/pb_driver-load.1.bz2 /usr/local/man/man1/pb_driver-unload.1.bz2

mkdir -p $(BINDIR) $(MAN1DIR) $(DOCDIR)
install pb_ctl/pb_ctl $(BINDIR)
install pb_ctl/pb_driver-load.sh $(BINDIR)/pb_driver-load
install pb_ctl/pb_driver-unload.sh $(BINDIR)/pb_driver-unload
install pb_ctl/pb_test-flash-2Hz.sh $(BINDIR)/pb_test-flash-2Hz
install pb_ctl/pb_test-flash-fastest-5.55MHz.sh $(BINDIR)/pb_test-flash-fastest-5.55MHz
install pb_ctl/pb_test-identify-output.sh $(BINDIR)/pb_test-identify-output
install README.txt LICENSE.txt doc/* $(DOCDIR)
install man/*.1.bz2 $(MAN1DIR)

clean:
cd kernel; rm -f *.o *.ko; cd -
rm -f kernel/*.o kernel/*.ko
rm -f man/*.bz2

uninstall:
@[ `whoami` = root ] || (echo "Error, please be root"; exit 1)
rm -rf /lib/modules/`uname -r`/kernel/3rdparty/pulseblaster
depmod -A
rm -f /etc/security/console.perms.d/90-pulseblaster.perms
rm -f /usr/local/bin/pbctl
rm -f /usr/local/bin/pb_driver-load
rm -f /usr/local/bin/pb_driver-unload
rm -f /usr/local/bin/pb_test-flash-2Hz
rm -f /usr/local/bin/pb_test-flash-fastest-5.55MHz
rm -f /usr/local/bin/pb_test-identify-output
rm -rf /usr/local/share/doc/pulseblaster
rm -f /usr/local/man/man1/pbctl.1.bz2
rm -f /usr/local/man/man1/pb_driver-load.1.bz2 /usr/local/man/man1/pb_driver-unload.1.bz2
rm -f /usr/local/man/man1/pb_test-flash-2Hz.1.bz2
rm -f /usr/local/man/man1/pb_test-flash-fastest-5.55MHz.1.bz2
rm -f /usr/local/man/man1/pb_test_identify_output.1.bz2

rm -f $(BINDIR)/pb_ctl
rm -f $(BINDIR)/pb_driver-load
rm -f $(BINDIR)/pb_driver-unload
rm -f $(BINDIR)/pb_test-flash-2Hz
rm -f $(BINDIR)/pb_test-flash-fastest-5.55MHz
rm -f $(BINDIR)/pb_test-identify-output
rm -f $(MAN1DIR)/pb_ctl.1.bz2
rm -f $(MAN1DIR)/pb_driver-load.1.bz2
rm -f $(MAN1DIR)/pb_driver-unload.1.bz2
rm -f $(MAN1DIR)/pb_test-flash-2Hz.1.bz2
rm -f $(MAN1DIR)/pb_test-flash-fastest-5.55MHz.1.bz2
rm -f $(MAN1DIR)/pb_test-identify_output.1.bz2
rm -rf $(DOCDIR)
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -40,7 +40,7 @@ USERSPACE

It's possible to just write directly to the /sys interface.

* pbctl and pb_utils provide helpful wrappers.
* pb_ctl and pb_utils provide helpful wrappers.
pb_utils can also assemble .vliw format files.

* pb_test-identify-output is useful for identifying channels.
Expand Down
2 changes: 1 addition & 1 deletion man/pb_driver-load.1
@@ -1,4 +1,4 @@
.TH "PB_DRIVER-[UN]LOAD" "1" "" "" "User Commands"
.TH "PB_DRIVER-[UN]LOAD" "1" "July 2012" "IR Camera System" "User Commands"
.SH "NAME"
\fBpb_driver-load\fR, \fBpb_driver-unload\fR

Expand Down
2 changes: 1 addition & 1 deletion man/pb_test-flash-2Hz.1
@@ -1,4 +1,4 @@
.TH "PB_TESTS" "1" "" "" "User Commands"
.TH "PB_TESTS" "1" "July 2012" "IR Camera System" "User Commands"
.SH "NAME"
\fBpb_test-flash-2Hz\fR, \fBpb_test-flash-fastest-5.55MHz\fR, \fBpb_test-identify-output\fR

Expand Down
4 changes: 2 additions & 2 deletions pb_ctl/pb_ctl
Expand Up @@ -18,13 +18,13 @@

=head1 NAME
pbctl - PulseBlaster control
pb_ctl - PulseBlaster control
=head1 SYNOPSIS
PulseBlaster control program: perl script to program and stop/start/arm/continue the PulseBlaster.
pbctl [OPTIONS]
pb_ctl [OPTIONS]
Options:
Expand Down
4 changes: 2 additions & 2 deletions pb_ctl/pb_test-identify-output.sh
Expand Up @@ -18,7 +18,7 @@ STOP=/sys/class/pulseblaster/pulseblaster0/stop

if [ "$1" == "-h" -o "$1" == "--help" ] ;then
echo "Identify pulseblaster outputs. Flash requested line at 2Hz."
echo "To verify phase (in case of inversion), the mark:space ratio is 1:3 (0.25s logic 1 : 0.75s logic 0)."
echo "To verify phase (in case of inversion), the mark:space ratio is 1:3 (0.125s logic 1 : 0.375s logic 0)."
echo "The other lines are always low."
echo "Usage: `basename $0` BIT_N"
echo " where BIT_N is 0 .. 23"
Expand Down Expand Up @@ -72,6 +72,6 @@ echo 1 > $START

#Say something
echo "Pulseblaster is now flashing output bit $BIT ($OUT) at 2Hz."
echo "The mark:space ratio is 1:3 (0.25s logic 1 : 0.75s logic 0). All other lines stay low."
echo "The mark:space ratio is 1:3 (0.125s logic 1 : 0.375s logic 0). All other lines stay low."
echo "To stop it: 'echo 1 > $STOP'"

0 comments on commit 86c31f6

Please sign in to comment.