From 69bab29834cbc63007acfa18a20793bfd9871788 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 22 May 2019 05:58:16 -0400 Subject: [PATCH] chg: params --- client/graph.c | 12 +++++++----- client/graph.h | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/graph.c b/client/graph.c index d2a816125..363dd0d61 100644 --- a/client/graph.c +++ b/client/graph.c @@ -16,13 +16,15 @@ int s_Buff[MAX_GRAPH_TRACE_LEN]; /* write a manchester bit to the graph TODO, verfy that this doesn't overflow buffer (iceman) */ -void AppendGraph(bool redraw, int clock, int bit) { - int i; +void AppendGraph(bool redraw, uint16_t clock, int bit) { + uint8_t half = clock / 2; + uint8_t i; //set first half the clock bit (all 1's or 0's for a 0 or 1 bit) - for (i = 0; i < (int)(clock / 2); ++i) - GraphBuffer[GraphTraceLen++] = bit ; + for (i = 0; i < half; ++i) + GraphBuffer[GraphTraceLen++] = bit; + //set second half of the clock bit (all 0's or 1's for a 0 or 1 bit) - for (i = (int)(clock / 2); i < clock; ++i) + for (; i < clock; ++i) GraphBuffer[GraphTraceLen++] = bit ^ 1; if (redraw) diff --git a/client/graph.h b/client/graph.h index accd64de8..2733bf475 100644 --- a/client/graph.h +++ b/client/graph.h @@ -18,7 +18,7 @@ #include "lfdemod.h" #include "cmddata.h" //for g_debugmode -void AppendGraph(bool redraw, int clock, int bit); +void AppendGraph(bool redraw, uint16_t clock, int bit); size_t ClearGraph(bool redraw); size_t getFromGraphBuf(uint8_t *buff); int GetAskClock(const char *str, bool printAns);