Originally filed as: https://github.com/libopencm3/libopencm3/pull/1224 Reviewed-by: Karl Palsson <karlp@tweak.net.au>