fix(MCU课设): 修正上一个bug
This commit is contained in:
parent
4a01b42afe
commit
c1e8bcc7cf
2 changed files with 13 additions and 3 deletions
|
@ -15,7 +15,7 @@
|
|||
#include "eeprom.h"
|
||||
#include "delay.h"
|
||||
|
||||
extern unsigned int bestScore[10];
|
||||
unsigned int bestScore[10]={0};
|
||||
|
||||
/*----------------------------
|
||||
Disable ISP/IAP/EEPROM function
|
||||
|
@ -90,7 +90,17 @@ void IapEraseSector(WORD addr)
|
|||
|
||||
void addBest(unsigned int s)
|
||||
{
|
||||
bestScore[2]=s;
|
||||
int i,j;
|
||||
for(i=0;i<10;i++)
|
||||
if(bestScore[i]<s)
|
||||
{
|
||||
for(j=9;j>i;j--)
|
||||
bestScore[j]=bestScore[j-1];
|
||||
|
||||
bestScore[i]=s;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void saveBest()
|
||||
|
|
|
@ -24,7 +24,7 @@ Menu* LAST = NULL; //
|
|||
enum OPR opr = idle;
|
||||
static unsigned char local[2] = {0};
|
||||
unsigned int score;
|
||||
unsigned int bestScore[10];
|
||||
extern unsigned int bestScore[10];
|
||||
extern enum GS blockGameStatus;
|
||||
|
||||
|
||||
|
|
Reference in a new issue