 	if (system_mode	!= ALARM_MODE)
 		system_mode	= SPEED_MODE;
 
-	deep_sleep	= false;
+	security_byte	= 0;
+}
+
+void stopwatch() {
+	if (!stopwatch_run) {
+		stopwatch_hour	= 0;
+		stopwatch_min	= 0;
+		stopwatch_sec	= 0;
+
+		char stopwatch_menu[][15] = {
+			"Start",
+			"Back"
+		};
+
+		if (display_list(stopwatch_menu, 2) == 0) {
+			stopwatch_run	= true;
+			stopwatch_hour	= hour();
+			stopwatch_min	= minute();
+			stopwatch_sec	= second();
+		}
+	}
+
+	if (stopwatch_run) {
+		while ((system_mode == STOPWATCH_MODE) && (sys_watch())) {
+			char stopwatch_menu[][15] = {
+				"Stop",
+				"Speedometr",
+				"Back"
+			};
+
+			bool	pause	= false;
+
+			unsigned int	start_stopwatch_time = (unsigned int)((stopwatch_hour * 3600) + (stopwatch_min * 60) + stopwatch_sec),
+							now_stopwatch_time = 0;
+
+			float	now_hour_stopwatch,
+					now_min_stopwatch,
+					now_sec_stopwatch;
+
+			lcd.clear();
+			lcd.print("00:00:00");
+
+			while (key_pressed(false) != BUT_OK) {
+				now_stopwatch_time	= ((hour() * 3600.0) + (minute() * 60.0) + second()) - start_stopwatch_time;	
+				now_hour_stopwatch	= (now_stopwatch_time / 3600.0);
+				now_min_stopwatch	= (now_hour_stopwatch - (byte)now_hour_stopwatch) * 60.0;
+				now_sec_stopwatch	= (now_min_stopwatch - (byte)now_min_stopwatch) * 60.0;
+
+				lcd.setCursor(0, 0);
+
+				if (now_hour_stopwatch < 10) {
+					lcd.print("0");
+				}
+
+				lcd.print((byte)now_hour_stopwatch);
+				lcd.setCursor(3, 0);
+
+				if (now_min_stopwatch < 10) {
+					lcd.print("0");
+				}
+
+				lcd.print((byte)now_min_stopwatch);
+				lcd.setCursor(6, 0);
+				
+				if (now_sec_stopwatch < 10) {
+					lcd.print("0");
+				}
+
+				lcd.print((byte)now_sec_stopwatch);
+				delay_w(1000);
+			}
+
+			while (analogRead(ACTION_BUTTON) > 5);
+
+			switch (display_list(stopwatch_menu, 3)) {
+				case 0:	stopwatch_run	= false;
+						break;
+
+				case 1:	system_mode	= SPEED_MODE;
+
+				default:	break;
+			}
+		}
+	}
+}
+
+void alarm() {
+	lcd.clear();
+	while (!read_password());
+
+	noTone(BIP);
+	lcd.clear();
+	lcd.print("Unlocking...");
+
+	digitalWrite(LOWER_LIGHT, LOW);
+	digitalWrite(HEADLIGHT, LOW);
+	digitalWrite(RED_BACK_LIGHT, LOW);
+	registerWrite(0);
+
+	unset_bit(btc_config.system_byte, ALARM_STATE);
+	unset_bit(btc_config.system_byte, ALARM_WRITED);
+	digitalWrite(EXT_ALARM, HIGH);
+
+	sys_wait_delay	= 0;
+	security_byte	= 0;
+	system_mode		= SPEED_MODE;
+
+	WriteSysConfEEPROM(btc_config, 0);
+
+	delay(500);
+	tone(BIP, 3000, 200);
+	delay(250);
+	tone(BIP, 3000, 200);
 }
}

void delay_w(int delay_num) {
	for (int	delay_count	= 0; ((delay_count < delay_num) && (sys_watch())); delay_count++, delay(1));
}

void system_sleep() {
	byte	count;

	registerWrite(0);
	digitalWrite(HEADLIGHT, LOW);
	digitalWrite(DISPLAY_LIGHT, LOW);
	digitalWrite(LOWER_LIGHT, LOW);
	digitalWrite(RED_BACK_LIGHT, LOW);

	deep_sleep	= true;

	while (true) {
		while ((sys_watch()) && (system_mode == SLEEP_MODE)) {

	#endif

	while (system_mode == SPEED_MODE) {

		if ((speed_old == speed_now) && (zero_speed_delay >= ZERO_SPEED_DEL)) {	// Обнуление скорости, если какое-то время скорость не меняется
			speed_now	= 0.0;
			speed_old	= 0.0;
			lcd.setCursor(5, 0);
			lcd.print("0.0   ");
		}

		if (speed_old > speed_now) {
			lcd.setCursor(5, 0);
			lcd.print("      ");
		}

		if ((bit_seted(btc_config.system_byte, RED_SPEED)) && (speed_old > speed_now) && ((speed_old - speed_now) >= SPEED_DEF)) {	// При сбросе скорости загорается красный
			digitalWrite(RED_BACK_LIGHT, HIGH);
			set_bit(road_signals, RED_STOP_SIGNAL);
		}

		if ((bit_seted(road_signals, RED_STOP_SIGNAL)) && (speed_now > speed_old)) {
			unset_bit(road_signals, RED_STOP_SIGNAL);
			if (bit_seted(btc_config.system_byte, AUTO_HEADLIGHT) && (analog_to_byte(analogRead(LIGHT_SENSOR)) > btc_config.lux_light_on))
				analogWrite(RED_BACK_LIGHT, btc_config.bright_headlight);
			else
				digitalWrite(RED_BACK_LIGHT, LOW);
		}

		if (speed_old != speed_now) {
			lcd.setCursor(5, 0);
			lcd.print(speed_now);
			speed_old	= speed_now;
			zero_speed_delay	= 0;
		}

		/*TIME START*/
