Index: /ar5315_microredboot/microredboot/boot/src/misc_lzma.c
===================================================================
--- /ar5315_microredboot/microredboot/boot/src/misc_lzma.c	(revision 12286)
+++ /ar5315_microredboot/microredboot/boot/src/misc_lzma.c	(revision 12287)
@@ -186,4 +186,7 @@
 static unsigned int sectorsize = 0x10000;
 static unsigned int linuxaddr = 0xbfc10000;
+/*
+ * searches for a directory entry named linux* vmlinux* or kernel and returns its flash address (it also initializes entrypoint and load address)
+ */
 unsigned int getLinux(void)
 {
@@ -267,5 +270,5 @@
 static int getGPIO(int nr)
 {
-	unsigned int *gpio = (unsigned int *)AR2316_GPIO_DI;
+	volatile unsigned int *gpio = (unsigned int *)AR2316_GPIO_DI;
 	if ((*gpio & 1 << nr) == (1 << nr))
 		return 1;
@@ -273,16 +276,9 @@
 }
 
+/*
+ * checks if the reset button is pressed, return 1 if the button is pressed and 0 if not
+ */
 static int resetTouched(void)
 {
-/*puts("gpio 5:");
-print_hex(getGPIO(5));
-puts("\r\n");
-puts("gpio 6:");
-print_hex(getGPIO(6));
-puts("\r\n");
-puts("gpio 7:");
-print_hex(getGPIO(7));
-puts("\r\n");
-*/
 	int trigger = getGPIO(RESETBUTTON & 0x0f);
 	if (RESETBUTTON & 0xf0)
@@ -333,4 +329,7 @@
 MACRO_END
 
+/*
+ * 
+ */
 static void delay_us(int us)
 {
@@ -629,5 +628,5 @@
 			break;
 		}
-		delay_us(20);
+		delay_us(200000);
 		spiflash_sendcmd(STM_OP_WR_ENABLE, 0);
 	} while (1);
@@ -661,5 +660,5 @@
 			if (!resetTouched()) // check if reset button is unpressed again
 				break;
-			delay_us(1000);
+			delay_us(1000000);
 		}
 		if (!count) {
@@ -700,9 +699,9 @@
 		regtmp = sysRegRead(AR2316_RESET);
 		sysRegWrite(AR2316_RESET, regtmp | mask);
-		delay_us(10);
+		delay_us(10000);
 
 		regtmp = sysRegRead(AR2316_RESET);
 		sysRegWrite(AR2316_RESET, regtmp & ~mask);
-		delay_us(10);
+		delay_us(10000);
 
 		regtmp = sysRegRead(AR2316_IF_CTL);
