Improve charlieplex generator

Signed-off-by: Paul Brook <paul@nowt.org>