Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
When an @Example block uses templates the documentation renders is fine but the "New file with this example" button doesn't handle it well.
Looks good:
When importing the code (uhh oh):
Here is a snippet of code to reproduce:
#ifndef ATOH_H #define ATOH_H #include <stdint.h> /** Convert a ASCII string to it's binary equivenent * * Example: * @code * #include "mbed.h" * #include "atoh.h" * * int main() * { * uint64_t result = atoh <uint64_t> ("0123456789abcdef" ); * uint32_t lo = result & 0x00000000ffffffff; * uint32_t hi = (result >> 32); * printf( "0x%08X%08X\n", hi, lo ); * printf( "0x%08X\n", atoh <uint32_t> ( "12345678" ) ); * printf( "0x%04X\n", atoh <uint16_t> ( "1234" ) ); * printf( "0x%02X\n", atoh <uint8_t> ( "12" ) ); * } * @endcode */ /** A templated method for ascii to hex conversions. Supported types are: * uint8_t, uint16_t, uint32_t and uint64_t * @param string - An ascii string of hex digits * @returns The binary equivelant of the string */ template<typename T> T atoh( char const *string ); #endifUsing Chrome V25 on windows 7 (beta not enabled)