This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example for synchronous signal processing with czmq/zloop using signalfd(2) | |
// Michael Haberler 1/2014 | |
#include <czmq.h> | |
#include <sys/signalfd.h> | |
int signo; | |
static int s_handle_signal(zloop_t *loop, zmq_pollitem_t *poller, void *arg) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example for integrating readline and | |
// synchronous signal delivery with czmq/zloop | |
// Michael Haberler 3/2014 | |
// gcc -g zreadline.o `pkg-config --cflags --libs libczmq` -lreadline -o zreadline | |
#include <stdio.h> | |
#include <readline/readline.h> | |
#include <readline/history.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you might have to: | |
# sudo easy_install cmd2 readline | |
# or the equivalent debian incantations, whatever they are | |
from cmd2 import Cmd | |
import linuxcnc | |
class MachinekitApp(Cmd): | |
def __init__(self): | |
Cmd.__init__(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newsig in0 bit | |
newsig in1 bit | |
loadrt lutn | |
newinst lutn or2.0 inputs=2 function=0xe | |
newinst lutn and2.0 inputs=2 function=0x8 | |
net in0 and2.0.in0 or2.0.in0 | |
net in1 and2.0.in1 or2.0.in1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/modules add | |
vcan | |
so the vcan module is loaded at boot | |
# in /etc/rc.local, add | |
ip link add dev vcan0 type vcan | |
ip link set up vcan0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this file to /etc/udev/rules.d: | |
# 04d8:000a USBtin | |
KERNEL=="ttyACM*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a",SYMLINK+="USBtin%n" ,RUN+="/usr/local/bin/slcan.sh /dev/%k can%n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: atomic-c++.s atomic-c.s atomic-c++ atomic-c | |
clean: | |
rm -f atomic-c++.s atomic-c.s atomic-c++ atomic-c | |
atomic-c++.s: atomic.c | |
gcc -x c++ -std=c++11 -Wa,-adhln -g $^ > $@ | |
atomic-c++: atomic.c | |
gcc -x c++ -std=c++11 -g $^ -o $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/default/ptpd | |
# Set to "yes" to actually start ptpd automatically | |
START_DAEMON=yes | |
# Add command line options for ptpd | |
PTPD_OPTS="-c /etc/ptpd.conf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# derived from http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Indigo%20on%20Raspberry%20Pi | |
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list' | |
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadrt hostmot2 | |
loadrt hm2_soc config="firmware=socfpga/soc_system.rbf num_encoders=2 num_pwmgens=2 num_stepgens=2" | |
newthread servo-thread 1000000 fp | |
newthread slow 1000000000 fp # 1sec | |
# task1: blink the leds CR01 and CR02 | |
newinst not osci | |
newinst not inverter |
OlderNewer