firmware: Fix make diffdump, it was broken by adding -S

The sed command ate parts of the code annotations in addition to the
instruction addresses.
firmware: Merge the two case statements in loop()
firmware: Add a CFLAGS variable to the Makefile
firmware: Restructure interrupt handling some more

This moves almost all the decisions from the INT0 ISR into the timer
ISR. By choosing more clever values for the action global, we can always
set its value by doing a full assignment, but check various aspects of
its value by checking bits.
firmware: Improve error reporting
firmware: Include delay.h

This file isn't currently needed, but is sometimes useful for debugging.
firmware: Fix sending of acks after being addressed
firmware: Don't use jump tables for switch blocks

If a switch block gets big enough, it turns out these jump tables
produce bigger code than the branch cascade generated for smaller switch
blocks (mostly due to a bit of extra setup code and extra push/pop
instructions).

Note that in the current code, the switch blocks are not big enough to
get a jump table, but this should prevent the compiler from using them
at all.
firmware: Use stall/ready during enumeration

This requires inverting the meaning of the stall and ready bits, as well
as letting each slave that sends a ready bit check the bus for a stall
bit, in case not all slaves are ready yet.
firmware: Two small optimizations

This saves a few bytes of flash, for some reason...
firmware: Use parity for all bytes
firmware: Remove parity states

Since parity sending now always happens, we simplify some code by
letting next_bit == 0 mean "send or receive parity" instead.
firmware: Move stall/ready bits before ack/nack bit

This changes the protocol to first send the stall/ready bits and only
after those send the ack/nack bit. This allows the slave to decide to
send a nack bit after it processes the byte received, instead of only
basing it on parity correctness.

Additionally, this changes causes the slave bit to send an ack after
every byte, not just the master-to-slave bytes.
firmware: Use a two-bit ack/nack

This allows the master to detect four different cases: Nobody send
ack or nack, everyone sent ack, everyone sent nack, both ack and nack
were sent.

This makes the code simpler than switching between high ack and low ack
depending on wether there were multiple devices on the bus, and also
gives a bit of extra info (allowing the master to detect if there are
no devices on the bus sooner).
firmware: Replace FLAG_RECEIVE with FLAG_IDLE

Previously, the idle state was entered when neither FLAG_SEND or
FLAG_RECEIVE was set. However, it's not common to enter idle mode (and
if it happens, the value of flags is no longer relevant). So, giving it
an explicit bit that can be assumed to be normally not set makes the
code a bit more compact (previously, all code had to either set
FLAG_SEND and reset FLAG_RECEIVE or vice versa, now it only needs to set
or reset FLAG_SEND).
firmware: Set next_bit and byte_buf after the ack/nack bit

Before, these values were set inside the main loop, since sometimes
a new byte would be begun without any ack/nack or ready bits before
them. Now that all bit sending and receiving goes through the ack/nack
bit, it makes sense to reset the next_bit and byte_buf variables after
the ack/nack bit, which saves a handfule of assignments in the mainloop.

One exception is after a reset, where no ack or nack is sent before
receiving the address, so the reset handler still sets these values as
well.
firmware: Small code cleanups
firmware: Find out what bit to send earlier

Instead of at the start of the INT0 ISR (e.g. at the start of a bit
period), we can now find out what bit to send at the end of the previous
bit instead. This was not previously possible since sometimes the
protocol jumped from STALL right into the first bit, without a ready or
ack bit in between, but this changed so we can now move this code.

This makes the INT0 ISR even smaller and more single-purpose, which is
nice. Additionally, it saves 16 bytes of flash space :-)
firmware: Use ID_OFFSET instead of literal 0
firmware: Don't bother reading the EEPROM while muted

During bus enumeration, as soon as slaves find out there is another
slave with a lower id, they'll mute themselves for the remainder of the
current enumeration round. When this happens, don't bother reading any
more bytes from EEPROM, they won't be sent anyway.