Further refactored printing code to be more readable

This commit is contained in:
BlackMark 2016-05-21 20:47:18 +02:00
parent 8ccddc483e
commit 02d5d34e72

View File

@ -21,67 +21,51 @@ int main()
cUSART << "\r\nSizes: \r\n";
sprintf( arrBuffer.data(), "%d\r\n", sizeof( char ) );
cUSART << "sizeof( char ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( char ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( unsigned char ) );
cUSART << "sizeof( unsigned char ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( unsigned char ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( short int ) );
cUSART << "sizeof( short int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( short int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( unsigned short int ) );
cUSART << "sizeof( unsigned short int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( unsigned short int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( int ) );
cUSART << "sizeof( int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( unsigned int ) );
cUSART << "sizeof( unsigned int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( unsigned int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( long int ) );
cUSART << "sizeof( long int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( long int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( unsigned long int ) );
cUSART << "sizeof( unsigned long int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( unsigned long int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( long long int ) );
cUSART << "sizeof( long long int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( long long int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( unsigned long long int ) );
cUSART << "sizeof( unsigned long long int ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( unsigned long long int ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( float ) );
cUSART << "sizeof( float ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( float ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( double ) );
cUSART << "sizeof( double ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( double ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n", sizeof( long double ) );
cUSART << "sizeof( long double ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( long double ) = " << arrBuffer.data();
sprintf( arrBuffer.data(), "%d\r\n\r\n", sizeof( void* ) );
cUSART << "sizeof( void* ) = ";
cUSART << arrBuffer.data();
cUSART << "sizeof( void* ) = " << arrBuffer.data();
while( true )
{
sprintf( arrBuffer.data(), "%lu", ui32Counter++ );
cUSART << "This has been running for \"";
cUSART << arrBuffer.data();
cUSART << "\" seconds!\r\n";
cUSART << "This has been running for \"" << arrBuffer.data() << "\" seconds!\r\n";
if( !cUSART.receiveLine( arrBuffer.data(), arrBuffer.size(), "\r" ) )
{
@ -92,8 +76,7 @@ int main()
cUSART << "Echo: ";
}
cUSART << arrBuffer.data();
cUSART << "\r\n";
cUSART << arrBuffer.data() << "\r\n";
uint8_t ui8Byte;