# HG changeset patch # User paul # Date 2017-01-18 08:39:47 # Node ID 8e6bb2d47c67e232f6373bf52123040b346cc2a0 # Parent 5bbd6be9fddce9f101bd7fb9b3c852eaf881914f test floatToChar function diff --git a/src/tc_load_dump_parameters.c b/src/tc_load_dump_parameters.c --- a/src/tc_load_dump_parameters.c +++ b/src/tc_load_dump_parameters.c @@ -1427,10 +1427,28 @@ void floatToChar( float value, unsigned unsigned char* valuePtr; valuePtr = (unsigned char*) &value; + ptr[BYTE_0] = valuePtr[BYTE_0]; ptr[BYTE_1] = valuePtr[BYTE_1]; ptr[BYTE_2] = valuePtr[BYTE_2]; ptr[BYTE_3] = valuePtr[BYTE_3]; + + // + printf("\n\n\n"); + + float aux = NAN; + unsigned char* auxPtr; + auxPtr = (unsigned char*) &aux; + + printf("aux = %f, value = %f\n", aux, value); + + auxPtr[BYTE_0] = valuePtr[BYTE_0]; + auxPtr[BYTE_1] = valuePtr[BYTE_1]; + auxPtr[BYTE_2] = valuePtr[BYTE_2]; + auxPtr[BYTE_3] = valuePtr[BYTE_3]; + + printf("aux = %f\n", aux); + // } //**********