diff --git a/MCU/MCU_5 _Wave_Generate/delay.h b/MCU/MCU_5 _Wave_Generate/delay.h
index ae46cf9..7d8d1d9 100644
--- a/MCU/MCU_5 _Wave_Generate/delay.h
+++ b/MCU/MCU_5 _Wave_Generate/delay.h
@@ -3,5 +3,6 @@
void delay(int i);
+void delayms(int n); //@11.0592MHz
#endif
\ No newline at end of file
diff --git a/MCU/MCU_REAL _FINAL/MCU_1.uvopt b/MCU/MCU_REAL _FINAL/MCU_1.uvopt
index ca2ce1a..19e6e61 100644
--- a/MCU/MCU_REAL _FINAL/MCU_1.uvopt
+++ b/MCU/MCU_REAL _FINAL/MCU_1.uvopt
@@ -213,7 +213,7 @@
1
1
1
- 0
+ 1
0
0
.\main.c
@@ -273,7 +273,7 @@
1
6
1
- 0
+ 1
0
0
.\block.c
@@ -373,6 +373,18 @@
0
0
+
+ 2
+ 14
+ 5
+ 0
+ 0
+ 0
+ ..\MCU_5 _Wave_Generate\delay.h
+ delay.h
+ 0
+ 0
+
diff --git a/MCU/MCU_REAL _FINAL/MCU_1.uvproj b/MCU/MCU_REAL _FINAL/MCU_1.uvproj
index 0feb962..9cd484a 100644
--- a/MCU/MCU_REAL _FINAL/MCU_1.uvproj
+++ b/MCU/MCU_REAL _FINAL/MCU_1.uvproj
@@ -446,6 +446,11 @@
5
.\block.h
+
+ delay.h
+ 5
+ ..\MCU_5 _Wave_Generate\delay.h
+
diff --git a/MCU/MCU_REAL _FINAL/delay.c b/MCU/MCU_REAL _FINAL/delay.c
index 983d71c..35f77ee 100644
--- a/MCU/MCU_REAL _FINAL/delay.c
+++ b/MCU/MCU_REAL _FINAL/delay.c
@@ -3,7 +3,26 @@
void delay(int n)
-{int i, j;
- for(i=n;i>0;i--)
- for(j = 7; j > 0; j--);
-}
\ No newline at end of file
+{
+ int i, j;
+ for(i = n; i > 0; i--)
+ for(j = 7; j > 0; j--);
+}
+
+void delayms(int n) //@11.0592MHz
+{
+ unsigned char i, j, k;
+ for(k = n; k > 0; k--)
+ {
+ _nop_();
+ _nop_();
+ _nop_();
+ i = 11;
+ j = 190;
+ do
+ {
+ while (--j);
+ }
+ while (--i);
+ }
+}
diff --git a/MCU/MCU_REAL _FINAL/delay.h b/MCU/MCU_REAL _FINAL/delay.h
index da40b5c..cb9e279 100644
--- a/MCU/MCU_REAL _FINAL/delay.h
+++ b/MCU/MCU_REAL _FINAL/delay.h
@@ -3,5 +3,5 @@
void delay(int i);
-void delay100us();
+void delayms(int k);
#endif
\ No newline at end of file
diff --git a/MCU/MCU_REAL _FINAL/main.c b/MCU/MCU_REAL _FINAL/main.c
index 9195ad8..376947a 100644
--- a/MCU/MCU_REAL _FINAL/main.c
+++ b/MCU/MCU_REAL _FINAL/main.c
@@ -52,7 +52,7 @@ void time() interrupt 1 //
if(PIN_4 == 0)
{
- delay(50);
+ delayms(15);
if(PIN_4 == 0)
opr = confirm;
}
diff --git a/MCU/MCU_REAL _FINAL/menu.c b/MCU/MCU_REAL _FINAL/menu.c
index 482ce47..9400f60 100644
--- a/MCU/MCU_REAL _FINAL/menu.c
+++ b/MCU/MCU_REAL _FINAL/menu.c
@@ -102,17 +102,15 @@ void m_block(struct _menu* this)
{
opr = idle;
moveLeftPiece();
- dropPiece();
- drawBlock();
- return;
+ drawBlock();
+ return;
}
if(opr == right)
{
opr = idle;
moveRightPiece();
- dropPiece();
- drawBlock();
- return;
+ drawBlock();
+ return;
}
switch(blockGameStatus)
{
@@ -134,7 +132,7 @@ void m_block(struct _menu* this)
dropPiece(); //若有需要,块下落
judgeBlock(); //若有需要,清除一行
drawBlock(); //绘制界面
- delay(800);
+ delayms(400);
}
@@ -148,7 +146,7 @@ void m_about(struct _menu* this)
LAST = &M_ABOUT;
drawNAME(); //绘制名字
- delay(5000);
+ delayms(2000);
drawNUMBER(); //绘制学号
}