Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2019-12-16 13:14:16 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2019-12-16 13:14:16 +0300
commit511b708290fb1458a35fb44dfbdcc1103c664b72 (patch)
tree985407fcfda15fa63d9f2c552cb65e6269f4c4f2 /pb_encode.h
parentb20bc5776509776cb0039562bc068e25eadca5eb (diff)
Add PB_CONVERT_DOUBLE_FLOAT setting to convert doubles on AVR.
This is easier to use than the old method of separate conversion functions. More importantly, it should allow running the same tests on AVR target.
Diffstat (limited to 'pb_encode.h')
-rw-r--r--pb_encode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/pb_encode.h b/pb_encode.h
index 66f6b2f..88e246a 100644
--- a/pb_encode.h
+++ b/pb_encode.h
@@ -165,6 +165,12 @@ bool pb_encode_fixed32(pb_ostream_t *stream, const void *value);
bool pb_encode_fixed64(pb_ostream_t *stream, const void *value);
#endif
+#ifdef PB_CONVERT_DOUBLE_FLOAT
+/* Encode a float value so that it appears like a double in the encoded
+ * message. */
+bool pb_encode_float_as_double(pb_ostream_t *stream, float value);
+#endif
+
/* Encode a submessage field.
* You need to pass the pb_field_t array and pointer to struct, just like
* with pb_encode(). This internally encodes the submessage twice, first to