diff options
author | 2017-06-20 10:24:05 +0000 | |
---|---|---|
committer | 2017-06-20 10:24:05 +0000 | |
commit | 32e25cbca210a359b09768537b6f443fe90a3070 (patch) | |
tree | 3309794c15d8a8f8e9c1c08cad072ee1378813ba /CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c | |
parent | 76c43dec62b2e21cd6446360c00d4fe6b437533f (diff) |
Separation Generator to a dedicated repo
Change-Id: Id94831651c3266861435272a6e36c7884bef2c45
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c')
-rw-r--r-- | CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c b/CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c deleted file mode 100644 index cd532d46..00000000 --- a/CAN-binder/libs/nanopb/examples/using_double_on_avr/encode_double.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Encodes a float value into a double on the wire. - * Used to emit doubles from AVR code, which doesn't support double directly. - */ - -#include <stdio.h> -#include <pb_encode.h> -#include "double_conversion.h" -#include "doubleproto.pb.h" - -int main() -{ - AVRDoubleMessage message = { - float_to_double(1234.5678f), - float_to_double(0.00001f) - }; - - uint8_t buffer[32]; - pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); - - pb_encode(&stream, AVRDoubleMessage_fields, &message); - fwrite(buffer, 1, stream.bytes_written, stdout); - - return 0; -} - |