Mikko Rasa [Sun, 3 Nov 2013 13:14:44 +0000 (15:14 +0200)]
Drop the pretense of C89, put declarations where they make sense
A lot of places already had mixed code and declarations, since that's
what I'm used to in C++. Might as well use them everywhere and tell
the compiler to use C99 mode.
Mikko Rasa [Sun, 3 Nov 2013 09:20:42 +0000 (11:20 +0200)]
Support chaining packets to create a larger packet
MFX packets with response windows won't fit into the 256 bits available
in a single packet structure. I'd rather keep the length field 8-bit to
preserve atomicity, and this also allows certain tricks later that would
be harder to do with a single packet.
Mikko Rasa [Wed, 30 Oct 2013 21:50:00 +0000 (23:50 +0200)]
Make arducontrol interface asynchronous again
Blocking the main loop for extended periods of time (as could previously
happen with an incomplete packet) is bad, because it prevents the monitor
from triggering overcurrent shutdown.
Mikko Rasa [Mon, 28 Oct 2013 20:20:28 +0000 (22:20 +0200)]
Send at least four S88 data octets per packets if possible
Each packet has three bytes of overhead, which is pretty significant if
only a single data byte is sent. Grouping them in larger units increases
throughput and only produces a negligible increase in latency.
Mikko Rasa [Mon, 28 Oct 2013 18:28:07 +0000 (20:28 +0200)]
Rewrite ringbuffer implementation to be interrupt-safe
The earlier version had a race condition with the fill variable, where an
interrupt might execute in the middle of increment/decrement and do the
opposite operation. Each variable is now written to by only one end of
the buffer, eliminating the problem.
Mikko Rasa [Fri, 12 Nov 2010 21:03:19 +0000 (21:03 +0000)]
Change the input filtering for better suitability for unreliable track circuits
Reduce the amount of spam sent by s88w-t
Optimize the LCD output code in s88w-r
Mikko Rasa [Wed, 27 Oct 2010 16:14:17 +0000 (16:14 +0000)]
Support multiple timers (currently 0 and 1)
Provide functions for setting timers in µs as well as Hz
Rewrite interrupt callbacks as macros that directly create the ISR
Add an async mode for LCD
Fix DDRB in s88w-t
Mikko Rasa [Sat, 25 Sep 2010 08:46:20 +0000 (08:46 +0000)]
Add some utility functions for interfacing with hardware
Improve makefile to support uploading to Arduino Mini
Expand s88w protocol to support multiple transmitters
Add lcd output to s88w-r for debugging