Fix the AskEdgeDetect cleaning tool
somehow it got broken. (maybe i had an incomplete pull request once upon a time)
This commit is contained in:
@@ -879,13 +879,15 @@ int CmdGraphShiftZero(const char *Cmd)
|
||||
int CmdAskEdgeDetect(const char *Cmd)
|
||||
{
|
||||
int thresLen = 25;
|
||||
int Last = 0;
|
||||
sscanf(Cmd, "%i", &thresLen);
|
||||
|
||||
for(int i = 1; i<GraphTraceLen; i++){
|
||||
if (GraphBuffer[i]-GraphBuffer[i-1]>=thresLen) //large jump up
|
||||
GraphBuffer[i-1] = 127;
|
||||
Last = 127;
|
||||
else if(GraphBuffer[i]-GraphBuffer[i-1]<=-1*thresLen) //large jump down
|
||||
GraphBuffer[i-1] = -127;
|
||||
Last = -127;
|
||||
GraphBuffer[i-1] = Last;
|
||||
}
|
||||
RepaintGraphWindow();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user