pepoとネットワークを語ろう

40年前からこれまでとこれからのネットワークを語る

pepopiface-0.4をリリースしました。いやーまいったちゃん(~_~;)

2014-12-27 05:21:11 | Linux

あかんはCも、暫くやらんと単純なミスに気がつかんわ

○ s_result = pfio_read_output() & patterns[port];

× s_result = pfio_read_output() && patterns[port];

○ int mysem_id = 0;

× uint16_t mysem_id = 0x0000;

mysem_id = semget(key, 1, 0666 | IPC_CREAT);

取得したmysem_idを使うとき×

https://sourceforge.jp/projects/pepolinux/releases/62474

pepoと


前から思っていたけど、Raspbianのプロントが長たらしいと思っていたけど、環境変数PS1を変更

2014-12-21 20:09:59 | Linux

root@remote-hand:/www/remote-hand/tmp#

root@remote-hand:/www/remote-hand/tmp# echo $PS1
${debian_chroot:+($debian_chroot)}\u@\h:\w\$

bash.bashrcを変更
root@remote-hand:/www/remote-hand/tmp# vi /etc/bash.bashrc

#PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
#pepo
PS1="[\u@\W]\\$ "

再度ログイン
[root@~]# cd /www/remote-hand/tmp/
[root@tmp]#

お・すんふぁん、すっきりしたわ


 


かなり苦労したけど、Semaphoreで排他制御させたpepopifaceをリリースしました。

2014-12-21 19:42:21 | Linux

/*
Copyright Isamu.Yamauchi 2013-2015. 2013.9.5, update 2014.12.21
This program uses the libpiface. thanks.
pepopiface.c is controls for Raspberry pi PiFace Digital I/O Expansion Board
*/

pepopiface are using Semaphore
First time to start without any options
[root@remote-hand ~]# pepopiface

** Welcome to pepopiface Version-0.3 Copyright Yamauchi.Isamu compiled:Dec 21 2014 **
usage:pepopiface port:0-8 [0|1] [timer:0-65535ms]

[root @ pepopiface] # ipcs -s

------ Semaphore Arrays --------
key semid owner perms nsems
0x530e3700 894009345 root 666 1
[root @ pepopiface] # ls /var/run/pepopiface.semaphore

Semaphore and file is created

usage:
[root@remote-hand ~]# pepopiface

** Welcome to pepopiface Version-0.3 Copyright Yamauchi.Isamu compiled:Dec 21 2014 **
usage:pepopiface port:0-8 [0|1] [timer:0-65535ms]

Concurrent read operation input port and output port
[root@remote-hand ~]# pepopiface 8
00ff[root@remote-hand ~]#
The high-order byte is the output port, the lower byte is the input port.

port0 write 1
[root@remote-hand ~]# pepopiface 0 1
1[root@remote-hand pepopiface]#

port0 write 0
[root@remote-hand ~]# pepopiface 0 0
0[root@remote-hand ~]#

port0 write 1 with timer
This operation is to "1" port of 0th 2 seconds.
[root@remote-hand ~]# pepopiface 0 1 2000
0[root@remote-hand ~]#

port0 read
[root@remote-hand ~]# pepopiface 0
1[root@remote-hand ~]#

Enjoy the piface and raspberry pi.