From: Rodolfo Giometti <giometti@enneenne.com>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: linux-kernel@vger.kernel.org, linuxpps@ml.enneenne.com,
Russell King <rmk+lkml@arm.linux.org.uk>,
Jan Dittmer <jdi@l4x.org>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH 1/1] LinuxPPS: Pulse per Second support for Linux
Date: Thu, 15 Mar 2007 11:29:12 +0100 [thread overview]
Message-ID: <20070315102912.GV3802@enneenne.com> (raw)
In-Reply-To: <20070314205732.GI22466@csclub.uwaterloo.ca>
[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]
On Wed, Mar 14, 2007 at 04:57:32PM -0400, Lennart Sorensen wrote:
>
> Well it does work for our GPS receiver at least. Of course I have to
> change the baud rate in the driver since our unit doens't use the NNEA
> standard 4800. And the configure script for ntp doesn't recognize the
> v2 PPSAPI, so I have to manually explain to it that I have the PPS API
> and it should actually include it.
Can you please provide a little help about it? A patch against current
wiki wuold be great! ;)
> Here is my utility for enabling PPS on my serial port now. Seems less
> of a pain that patching setserial and including that (with 256MB flash
> space, setserial seems wasteful).
I modify your code add inquiry functionality. Can you please test it?
See http://ftp.enneenne.com/pub/misc/linuxpps/test/ and the wiki at
http://wiki.enneenne.com/index.php/LinuxPPS_support#Compiling_the_code.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti@enneenne.com
Linux Device Driver giometti@gnudd.com
Embedded Systems giometti@linux.it
UNIX programming phone: +39 349 2432127
[-- Attachment #2: ppsctl.c --]
[-- Type: text/x-csrc, Size: 1213 bytes --]
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <linux/serial.h>
void usage(char *name)
{
fprintf(stderr, "usage: %s <ttyS> [enable|disable]\n", name);
exit(EXIT_FAILURE);
}
int main(int argc, char *argv[])
{
int fd, ret;
struct serial_struct ss;
if (argc < 2)
usage(argv[0]);
fd = open(argv[1], O_RDWR);
if (fd < 0) {
perror("open");
exit(EXIT_FAILURE);
}
ret = ioctl(fd, TIOCGSERIAL, &ss);
if (ret < 0 ) {
perror("ioctl(TIOCGSERIAL)");
exit(EXIT_FAILURE);
}
if (argc < 3) { /* just read PPS status */
printf("PPS is %sabled\n",
ss.flags & ASYNC_HARDPPS_CD ? "en" : "dis");
exit(EXIT_SUCCESS);
}
if (argv[2][0] == 'e' || argv[2][0] == '1')
ss.flags |= ASYNC_HARDPPS_CD;
else if (argv[2][0] == 'd' || argv[2][0] == '0')
ss.flags &= ~ASYNC_HARDPPS_CD;
else {
fprintf(stderr, "invalid state argument \"%s\"\n", argv[2]);
exit(EXIT_FAILURE);
}
ret = ioctl(fd, TIOCSSERIAL, &ss);
if (ret < 0) {
perror("ioctl(TIOCSSERIAL)");
exit(EXIT_FAILURE);
}
return 0;
}
next prev parent reply other threads:[~2007-03-15 10:28 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-16 18:52 [PATCH 1/1] LinuxPPS: Pulse per Second support for Linux Rodolfo Giometti
2007-02-16 19:12 ` Russell King
2007-02-16 20:43 ` Rodolfo Giometti
2007-02-16 20:51 ` Russell King
2007-02-16 21:03 ` Rodolfo Giometti
2007-02-16 19:56 ` Jan Dittmer
2007-02-16 20:57 ` Rodolfo Giometti
2007-02-16 21:19 ` Jan Dittmer
2007-02-18 22:43 ` LinuxPPS: fixes Rodolfo Giometti
2007-02-20 2:56 ` [PATCH 1/1] LinuxPPS: Pulse per Second support for Linux H. Peter Anvin
2007-02-21 12:04 ` Rodolfo Giometti
2007-02-21 16:14 ` H. Peter Anvin
2007-02-22 8:51 ` Rodolfo Giometti
2007-02-21 23:51 ` Roman Zippel
2007-02-22 9:00 ` Rodolfo Giometti
2007-02-21 10:16 ` Pavel Machek
2007-02-22 9:59 ` Rodolfo Giometti
2007-03-13 21:38 ` Rodolfo Giometti
2007-03-13 22:48 ` Lennart Sorensen
2007-03-14 9:31 ` Rodolfo Giometti
2007-03-14 13:19 ` Lennart Sorensen
2007-03-14 14:06 ` Rodolfo Giometti
2007-03-14 14:12 ` Lennart Sorensen
2007-03-14 14:27 ` Rodolfo Giometti
2007-03-14 14:42 ` Lennart Sorensen
2007-03-14 14:52 ` Rodolfo Giometti
2007-03-14 15:37 ` Lennart Sorensen
2007-03-14 15:47 ` Rodolfo Giometti
2007-03-14 20:57 ` Lennart Sorensen
2007-03-15 10:29 ` Rodolfo Giometti [this message]
2007-03-15 15:18 ` Lennart Sorensen
2007-03-15 15:37 ` Rodolfo Giometti
-- strict thread matches above, loose matches on Subject: below --
2007-03-21 7:41 Rodolfo Giometti
2007-03-21 8:05 ` Jon K Hellan
2007-03-21 8:08 ` Rodolfo Giometti
2007-03-21 15:34 ` Lennart Sorensen
2007-05-02 19:33 ` Rodolfo Giometti
2007-05-02 21:06 ` john stultz
2007-05-03 10:03 ` Rodolfo Giometti
2007-05-10 7:27 ` Andrew Morton
2007-05-10 9:48 ` Andrew Morton
2007-05-10 10:58 ` Rodolfo Giometti
2007-05-10 11:01 ` David Miller
2007-05-10 11:45 ` Rodolfo Giometti
2007-05-10 11:51 ` David Miller
2007-05-10 11:54 ` David Miller
2007-05-12 5:59 ` Rodolfo Giometti
2007-05-12 6:17 ` Andrew Morton
2007-05-12 7:08 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070315102912.GV3802@enneenne.com \
--to=giometti@enneenne.com \
--cc=jdi@l4x.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxpps@ml.enneenne.com \
--cc=lsorense@csclub.uwaterloo.ca \
--cc=pavel@ucw.cz \
--cc=rmk+lkml@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).