[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] Simple UART support
From: |
ken restivo |
Subject: |
Re: [Simulavr-devel] Simple UART support |
Date: |
Fri Sep 13 22:12:01 2002 |
User-agent: |
Mutt/1.3.25i |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thu, Sep 12, 2002 at 10:13:30PM -0700, Theodore A. Roth wrote:
> Cool. Thanks Ken.
>
> Couple of notes:
>
> - The copyright should be this:
>
> + * Copyright (C) 2002 Ken Restivo
Cool. Feel free to add it, or I might be able to generate another patch.
It's painful for me to generate patches; I have many changes in there
that do various unrelated things, which I have to manually weed out
before sending a patch.
>
> - If you use cvs to generate the patch, it is _sooo_ much easier. For new
> files, you'll just need to do this:
>
> $ cvs diff -u > foo.diff
> $ for file in $new_files
> do
> diff -u /dev/null $file >> foo.diff
> done
Thanks for the /dev/null tip. I really got burnt by the fact that cvs diff -uN
doesn't automatically grab the new files, unless they've first been cvs add'ed.
Luckily, I keep backups.
>
> Make sure the patch to $new_files is the same as that which cvs diff gives.
>
> I'll take a better look at this over the weekend and see about committing
> it.
>
> Ted Roth
>
> On Thu, 12 Sep 2002, ken restivo wrote:
>
> :)And here it is: a patch against today's CVS which adds rudimentary UART
> :)support.
> :)
> :)What it does:
> :) - Read/write UART data from apps which use a simple tight polled loop
> :) - Accept an arg (--uart-tty=/path) from which to send/receive UART chars
> :) - Check RXEN/TXEN and complain if the app doesn't set them properly
> :) - Let the app read/write UDR, UBRR, UCSRA, and UCSRB.
> :) - Defines all the bits and masks for my part (atmega163).
> :)
> :)What it does not:
> :) - UART interrupts
> :) - Deal with RXC/TXC bits intelligently.
> :) - Any tty mode-mangling. I figured the sim shouldn't; let the user do
> it.
> :) - Network or UNIX sockets, though it'd be pretty easy to implement.
> :) - Other UART register layouts from other parts, or multiple UARTS.
> :)
> :)I'm using it with a /dev/pts/xx on linux, simulating a mega163, and all is
> :)well so far. This should get me through testing/debugging my app (I'm
> :)really fatigued with object-oriented programming at this point, and am
> :)chomping at the bit to get back to my assembly code again! ;-). But, at
> :)some point soon, I'll need to add interrupt support, if someone else
> :)doesn't do it first.
> :)
> :)Oh, and I wasn't sure where to put the read/write functions, so I left
> :)them in main.c. Also all the opening of fd's and adding of callbacks
> :)probably wants to get moved into a setup_uart_external() or some such
> :)method, but I wasn't sure where to put it or what to call it, so I left
> :)all that stuff sitting there loose in main(). My apologies.
> :)
> :)-ken
> :)
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9gpq4e8HF+6xeOIcRAm4BAJ9rCzhiS49AsvQ8BSuqIXRkEneylACg6H7r
ws1lmUEXUb2ItZ6nfTJJNG4=
=kcB8
-----END PGP SIGNATURE-----