]> sigrok.org Git - libsigrok.git/blobdiff - src/output/analog.c
sysclk-lwla: Implement support for LWLA1016
[libsigrok.git] / src / output / analog.c
index 4535ed5ca76267ef75cd07829b2bbc381ad78a8a..ed480ca0335385af204804cad0f5d0003b228da6 100644 (file)
@@ -68,7 +68,7 @@ static int init(struct sr_output *o, GHashTable *options)
        return SR_OK;
 }
 
-static void si_printf(float value, GString *out, char *unitstr)
+static void si_printf(float value, GString *out, const char *unitstr)
 {
        float v;
 
@@ -336,8 +336,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
                        for (l = analog->meaning->channels, c = 0; l; l = l->next, c++) {
                                ch = l->data;
                                g_string_append_printf(*out, "%s: ", ch->name);
-                               sr_analog_float_to_string(fdata[i * num_channels + c],
-                                               digits, &number);
+                               number = g_strdup_printf("%.*f", digits,
+                                               fdata[i * num_channels + c]);
                                g_string_append(*out, number);
                                g_free(number);
                                g_string_append(*out, " ");