Skip to content

Commit

Permalink
Fix unguarded if and for blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
MarSoft committed Jul 20, 2018
1 parent 3b6ed55 commit 500bc8f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Calibrat.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ void Calibrat(u8 Channel)
if(Channel == TRACK2){ //above the signal to the noise in the the steps
Offset=((V_max-(b_Avg/4096))+(V_min-(b_Avg/4096))); //below the signal
}
if(Offset<-2)Offset=-2; if(Offset>2)Offset=2; Offset+=2; //limit to +/- 2 steps
if(Offset<-2) { Offset=-2; } if(Offset>2) { Offset=2; } //limit to +/- 2 steps
Offset+=2; //convert to array index
Print_Str( 3*8, 208, 0x0305, PRN,(char*)CenterStep); //31 chars
Print_Str( 36*8, 208, 0x0405, PRN,(char*)CenterStr[Offset]); //11 chars
}else{
Expand Down
9 changes: 6 additions & 3 deletions Draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,8 @@ void LoadFFTbuffer(u16 Row,u8 buffer){
if(fi[fftx+1]>173)TraceShadow(174,fi[fftx+1]+2,buffer);
if(fi[fftx-1]>173)TraceShadow(174,fi[fftx-1]+2,buffer);

for(i=Y_BASE+1;i<val; i++) LCD_Buffer[buffer][i] = GRN; if(val>173)LCD_Buffer[buffer][i]=BLACK;
for(i=Y_BASE+1;i<val; i++) LCD_Buffer[buffer][i] = GRN;
if(val>173) LCD_Buffer[buffer][i]=BLACK;
if((FlagMeter>0)||((DownConvertMode)&&(FFTt1Mode==0))){
if ((fftx == imax - 4) || (fftx == imax + 4)) {
for (i=PeakFreq - 1; i<PeakFreq+1; i++) {
Expand Down Expand Up @@ -2208,8 +2209,10 @@ u8 j;
*/

if(DownConvertMode==0){
for(j=0;j<5;j++)Nfreq[j]=NFreqStr[j]; Nfreq[3+index+index]=0;
for(j=0;j<2;j++)Nsuffix[j]=NFreqStr[j+(4+index+suffix)]; Nsuffix[2]=0;
for(j=0;j<5;j++)Nfreq[j]=NFreqStr[j];
Nfreq[3+index+index]=0;
for(j=0;j<2;j++)Nsuffix[j]=NFreqStr[j+(4+index+suffix)];
Nsuffix[2]=0;
}

}
Expand Down
6 changes: 4 additions & 2 deletions Function.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,15 @@ void fix_fft(s32 fr[], s32 fi[], short size) // m = number of bits of the FFT s
// H/W divide and single cycle multiply):

tr=(wr*(fr[j]>>shift))>>(14-shift); //shift extends dynamic range for log display
if(tr&1)tr++; tr>>=1;
if(tr&1)tr++;
tr>>=1;
c=(wi*(fi[j]>>shift))>>(14-shift);
if(c&1)c++;
tr-=c>>1;

ti=(wr*(fi[j]>>shift))>>(14-shift);
if(ti&1)ti++; ti>>=1;
if(ti&1)ti++;
ti>>=1;
c=(wi*(fr[j]>>shift))>>(14-shift);
if(c&1)c++;
ti+=c>>1;
Expand Down
8 changes: 6 additions & 2 deletions Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,12 @@ void Process(void)
else d_Max = _4_posi + 20;

if((ChartLogic())&&(FrameMode==0)&&(ScrollFlag>0)){
if((JumpCnt>(380+_X_posi.Value))){_X_posi.Value=(JumpCnt-380);if((Current!=FILE)&&(NotificationTimer==0))
Update_View_Area();ScrollFlag=1;}
if((JumpCnt>(380+_X_posi.Value))){
_X_posi.Value=(JumpCnt-380);
if((Current!=FILE)&&(NotificationTimer==0))
Update_View_Area();
ScrollFlag=1;
}
if((ScrollFlag==1)&&(JumpCnt<=380)){_X_posi.Value=0;if(Current!=FILE)Update_View_Area();}
XposRef=GetXposRef(_X_posi.Value);
}
Expand Down

0 comments on commit 500bc8f

Please sign in to comment.