MarkT:
Anyway there's no need for % at all, each use can be replaced by a conditional subtraction of _SS_MAX_RX_BUFF from the variable that should be wrapping-round.
That's what I did but it runs slower than the original code with a buffer size of 2^n
The original would work at 38.4k with no problem but then you need a buffer size of 128 etc.
My original problem was that the thing fell over with a buffer size of 100, which started the investigation and head scratching.
... Simon