Added STM8 code + minor fixes for Hadamard matrix code