<file_sep>/*----------------------------------------------------------------------------
 * Name:    sample.c
 * Purpose: to control led through EINT buttons and manage the bouncing effect
 *        	- key1 switches on the led at the left of the current led on, 
 *					- it implements a circular led effect. 	
  * Note(s): this version supports the LANDTIGER Emulator
 * Author: 	<NAME> - PoliTO - last modified 15/12/2020
 *----------------------------------------------------------------------------
 *
 * This software is supplied "AS IS" without warranties of any kind.
 *
 * Copyright (c) 2017 Politecnico di Torino. All rights reserved.
 *----------------------------------------------------------------------------*/
                  
#include <stdio.h>
#include "LPC17xx.H"                    /* LPC17xx definitions                */
#include "led/led.h"
#include "button_EXINT/button.h"
#include "timer/timer.h"
#include "RIT/RIT.h"
#include "stdbool.h"
#include "variables.h"
/* Led external variables from funct_led */
extern unsigned char led_value;					/* defined in funct_led								*/
#ifdef SIMULATOR
extern uint8_t ScaleFlag; // <- ScaleFlag needs to visible in order for the emulator to find the symbol (can be placed also inside system_LPC17xx.h but since it is RO, it needs more work)
#endif


int labyrinth[13][15] = {
				{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2},
				{0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0},
				{1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0},
				{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
				{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
				{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
				{1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
				{1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
				{1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
				{2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2},					
				};

void startGame(){
start = 1;
}
				

				
bool led_est_acceso = false;
bool led_ovest_acceso = false;
bool led_nord_acceso = false;				
bool led_sud_acceso = false;			
			
	
const int led_running = 5;  
bool led_running_acceso = false;	
/*
 0 -> est
 1 -> nord
 2 -> ovest
 3 -> sud
*/				
//int direzione_arr[] = {0,1,2,3};			
int direzione = 0; 
int pos_X = 7;
int pos_Y = 7;
int distance = 5;
int button = -1;
int win=0;
int win_flag=0;
int conteggio;
bool start=false;

void runTimer(){
		reset_timer(0);
		LED_Out(0);
	if(win==1) 
		{
			LED_Out(0);
			reset_timer(0);
			init_timer(0, 25000000/(2*1));
			enable_timer(0);
		}
	else if(distance > 5)	{
		switch(direzione){
			case 0:
				LED_Off(0);
				break;
			case 1:
				LED_Off(1);
				break;
			case 2:
				LED_Off(2);
				break;
			case 3:
				LED_Off(0);
				break;
		}
		}
		else if((distance >= 3 && distance <= 5) && win_flag==0) 
		{
			init_timer(0, 25000000/(2 *2));
			enable_timer(0);
		}
		else if((distance > 0 && distance <3)&& win_flag==0) 
		{
			init_timer(0, 25000000/(2 *4));
			enable_timer(0);
		}
		else if (win_flag==0)
			{
			init_timer(0, 25000000/(2 *5));
			enable_timer(0);	
			}

	
}

void run(void){
calc_distance();
if(distance<=0){}
else move();
runTimer();

}

void rotate(){
	if(direzione == 0) direzione = 3;
	else direzione = direzione - 1;
	LED_Out(0);
	calc_distance();
	runTimer();
}


void buttonRun(void){
	if(start)	run();
	//runLed();
}

void buttonStart(void){
	startGame();
	calc_distance();
	runTimer();
}

void buttonRotate(void){
	if(start){
	rotate();	
	calc_distance();
	}
}

void calc_distance(void){
	int i=0;
	if(direzione == 0)
		{
		//Calcolo distanza verso est
		
		win_flag=0;	
		for(i = pos_X+1; i<15; i++)
			{
			if(labyrinth[pos_Y][i] == 1) break;
			if(labyrinth[pos_Y][i] == 2) 
			{
			win_flag=1;
			}
			}
		distance = i - pos_X - 1 ;
		}
	//Calcolo distanza verso nord
	else if(direzione == 1)
		{
		
		win_flag=0;
		for(i = pos_Y-1; i>=0; i--){
			if(labyrinth[i][pos_X] == 1) break;
			if(labyrinth[i][pos_X] == 2) 
			{
			win_flag=1;
			}
		}
		distance = pos_Y - i - 1;
		}
	//Calcolo distanza verso ovest
	else if(direzione == 2)
		{
	
	win_flag=0;	
	for(i = pos_X-1; i>=0; i--){
			if(labyrinth[pos_Y][i] == 1) break;
			if(labyrinth[pos_Y][i] == 2) 
			{
			win_flag=1;
			}
		}
		distance = pos_X - i - 1;
		}
	
	//Calcolo distanza verso sud
	else if(direzione == 3){
		win_flag=0;
		for(i = pos_Y+1; i<13; i++){
			if(labyrinth[i][pos_X] == 1) break;
			if(labyrinth[i][pos_X] == 2) 
			{
			win_flag=1;
			}
		}
	distance = i - pos_Y - 1;
	}
	
}
	

void move(void){
if((pos_X>=0 && pos_X<=15) && (pos_Y>=0 && pos_Y<=12)){
switch(direzione){
	case 0:
		if(labyrinth[pos_Y][pos_X+1] != 1)
			{ 
			pos_X++;
			break;
			}
	case 1:
		if(labyrinth[pos_Y-1][pos_X] != 1)
		pos_Y--;
		break;
	case 2:
		if(labyrinth[pos_Y][pos_X-1] != 1)
		pos_X--;
		break;
	case 3:
		if(labyrinth[pos_Y+1][pos_X] != 1)
		pos_Y++;
		break;
}
if(labyrinth[pos_Y][pos_X]==2) win=1;
calc_distance();
}
}

/*----------------------------------------------------------------------------
  Main Program
 *----------------------------------------------------------------------------*/	


int main (void) {
		
	SystemInit();  												/* System Initialization (i.e., PLL)  */
  LED_init();                           /* LED Initialization                 */
  BUTTON_init();												/* BUTTON Initialization              */
	//init_timer(0,312500);									//0x017D7840	
	init_RIT(1250000);										/* RIT Initialization 50 msec       */
	LED_Out(0);														//spegniamo tutti i led

	LPC_SC->PCON |= 0x1;									/* power-down	mode										*/
	LPC_SC->PCON &= ~(0x2);	
	
  while (1) {                    				 //       Loop forever                      
		__ASM("wfi");
		
		
  }
	
}
<file_sep># Blind_Labyrinth_Simulator
Simulation of the game Blind Labyrinth using a LPC176x/5x Microcontroller
<file_sep><html>
<body>
<pre>
<h1>ÁVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ÁVision V5.33.0.0
Copyright (C) 2020 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: <NAME>, Politecnico di Torino, LIC=----
 
Tool Versions:
Toolchain:       MDK-Lite  Version: 5.33.0.0
Toolchain Path:  C:\Keil_v5\ARM\ARMCC\Bin
C Compiler:      Armcc.exe V5.06 update 7 (build 960)
Assembler:       Armasm.exe V5.06 update 7 (build 960)
Linker/Locator:  ArmLink.exe V5.06 update 7 (build 960)
Library Manager: ArmAr.exe V5.06 update 7 (build 960)
Hex Converter:   FromElf.exe V5.06 update 7 (build 960)
CPU DLL:         SARMCM3.DLL V5.33.0.0
Dialog DLL:      DARMP1.DLL V1.27.0.0
Target DLL:      UL2CM3.DLL V1.163.9.0
Dialog DLL:      TARMP1.DLL V1.26.0.0
 
<h2>Project:</h2>
F:\UniversitÓ\Magistrale\Architetture dei Sistemi di Elaborazione\Labs\extra_points_2\sample.uvprojx
Project File Date:  01/17/2021

<h2>Output:</h2>
*** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
compiling IRQ_RIT.c...
RIT\../variables.h(17): warning:  #1295-D: Deprecated declaration game_init - give arg types
  extern void game_init();
RIT\../variables.h(24): warning:  #1295-D: Deprecated declaration buttonRun - give arg types
  extern void buttonRun();
RIT\../variables.h(25): warning:  #1295-D: Deprecated declaration buttonStart - give arg types
  extern void buttonStart();
RIT\../variables.h(26): warning:  #1295-D: Deprecated declaration move - give arg types
  extern void move();
RIT\../variables.h(27): warning:  #1295-D: Deprecated declaration drawButtons - give arg types
  extern void drawButtons(); 
RIT\../variables.h(28): warning:  #1295-D: Deprecated declaration drawBot - give arg types
  extern void drawBot();		
RIT\../variables.h(29): warning:  #1295-D: Deprecated declaration drawGrid - give arg types
  extern void drawGrid();
RIT\../variables.h(30): warning:  #1295-D: Deprecated declaration clearBot - give arg types
  extern void clearBot();
RIT\../variables.h(31): warning:  #1295-D: Deprecated declaration restartGame - give arg types
  extern void	restartGame();
RIT\../variables.h(32): warning:  #1295-D: Deprecated declaration startGame - give arg types
  extern void startGame();
RIT\IRQ_RIT.c(41): warning:  #223-D: function "changeMode" declared implicitly
  				changeMode();
RIT\IRQ_RIT.c: 11 warnings, 0 errors
linking...
Program Size: Code=27432 RO-data=1772 RW-data=872 ZI-data=680  
".\sample.axf" - 0 Error(s), 11 Warning(s).

<h2>Software Packages used:</h2>

Package Vendor: ARM
                http://www.keil.com/pack/ARM.CMSIS.5.7.0.pack
                ARM.CMSIS.5.7.0
                CMSIS (Cortex Microcontroller Software Interface Standard)
   * Component: CORE Version: 5.4.0

Package Vendor: Keil
                http://www.keil.com/pack/Keil.LPC1700_DFP.2.6.0.pack
                Keil.LPC1700_DFP.2.6.0
                NXP LPC1700 Series Device Support, Drivers and Examples for MCB1700 and LPC1788-32

<h2>Collection of Component include folders:</h2>
  .\RTE\_Target_1
  C:\Users\Luca\AppData\Local\Arm\Packs\ARM\CMSIS\5.7.0\CMSIS\Core\Include
  C:\Users\Luca\AppData\Local\Arm\Packs\Keil\LPC1700_DFP\2.6.0\Device\Include

<h2>Collection of Component Files used:</h2>

   * Component: ARM::CMSIS:CORE:5.4.0
Build Time Elapsed:  00:00:01
</pre>
</body>
</html>
<file_sep>#include "stdbool.h"


extern bool start;

extern int direzione;
extern int button;


extern int pos_X;
extern int pos_Y;
extern int distance;
extern int win;
extern int win_flag;
extern int conteggio;	
extern int mode;
extern void game_init();

extern void rotate(void);
extern void run(void);
extern void calc_distance(void);
extern int labyrinth[13][15];
extern void buttonRotate(void);
extern void buttonRun();
extern void buttonStart();
extern void move();
extern void drawButtons(); 
extern void drawBot();		
extern void drawGrid();
extern void clearBot();
extern void	restartGame();
extern void startGame();
<file_sep>#include "stdbool.h"


#define led_est 2
#define led_ovest 0
#define led_nord  3				
#define led_sud  1				
				
extern bool led_est_acceso;
extern bool led_ovest_acceso;
extern bool led_nord_acceso;				
extern bool led_sud_acceso;
extern bool led_running_acceso;	
extern bool start;

extern int direzione;
extern int button;


extern int const led_running;
extern bool led_zero;

extern int pos_X;
extern int pos_Y;
extern int distance;
extern int win;
extern int win_flag;
extern int conteggio;	

extern void rotate(void);
extern void run(void);
extern void calc_distance(void);
extern int labyrinth[13][15];
extern void buttonRotate(void);
extern void buttonRun();
extern void buttonStart();
extern void move();
		
<file_sep>/*********************************************************************************************************
**--------------File Info---------------------------------------------------------------------------------
** File name:           IRQ_RIT.c
** Last modified Date:  2014-09-25
** Last Version:        V1.00
** Descriptions:        functions to manage T0 and T1 interrupts
** Correlated files:    RIT.h
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#include "lpc17xx.h"
#include "RIT.h"
#include "../led/led.h"
#include "../variables.h"

/******************************************************************************
** Function name:		RIT_IRQHandler
**
** Descriptions:		REPETITIVE INTERRUPT TIMER handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/



void RIT_IRQHandler (void)
{			
	//static int down =0;
	static int down0=0;	
	static int down1=0;
	static int down2=0;
	
	//10, 11, 12
	//button0, button1, button2
	
if(button==0){
	down0++;

	if((LPC_GPIO2->FIOPIN & (1<<10)) == 0 && !(LPC_PINCON->PINSEL4 &(1<<20))){
		//	static uint8_t position=0;
		reset_RIT();
		switch(down0){
			case 1:
				buttonStart();
			
				/*if( position == 7){
					LED_On(0);
					LED_Off(7);
					position = 0;
					*/
			
			}
		}else{ /* button released */
				
				down0 = 0;
				button = -1;
				disable_RIT();
				reset_RIT();
				NVIC_EnableIRQ(EINT0_IRQn);
				LPC_PINCON->PINSEL4 |= (1 << 20);
					//LED_Off(position);
					//LED_On(++position);
				}
}else if(button==1){
	down1++;
	if((LPC_GPIO2->FIOPIN & (1<<11)) == 0 && !(LPC_PINCON->PINSEL4 &(1<<22))){
		//	static uint8_t position=0;
		

		reset_RIT();
		
		}else{ /* button released */
				if(down1>3)	buttonRotate();
				down1 = 0;
				button = -1;
				disable_RIT();
				reset_RIT();
				NVIC_EnableIRQ(EINT1_IRQn);
				LPC_PINCON->PINSEL4 |= (1 << 22);
					//LED_Off(position);
					//LED_On(++position);
				}
		}		
else if(button==2){ //Bottone per muovere il robot = run()

	
if((LPC_GPIO2->FIOPIN & (1<<12)) == 0 && !(LPC_PINCON->PINSEL4 &(1<<24))){
		//	static uint8_t position=0;
		down2++;
		reset_RIT();
		
		if(down2%40==0){
				buttonRun();
			}
		if(distance==0 && win!=1)
			{
			if(down2%20==10) LED_On(led_running);
			if(down2%20==0) LED_Off(led_running);
			}
		else if(win!=1)
		{
		if(down2%40==20) LED_On(led_running);
		if(down2%40==0) LED_Off(led_running);
		}
		
		}else{ /* button released */
				if(win!=1) LED_Off(led_running);
				down2 = 0;
				button = -1;
				disable_RIT();
				reset_RIT();
				NVIC_EnableIRQ(EINT2_IRQn);
				LPC_PINCON->PINSEL4 |= (1 << 24);
				}
		}
	
  LPC_RIT->RICTRL |= 0x1;	/* clear interrupt flag */
	
  return;
}

/******************************************************************************
**                            End Of File
******************************************************************************/
<file_sep>/*********************************************************************************************************
**--------------File Info---------------------------------------------------------------------------------
** File name:           IRQ_timer.c
** Last modified Date:  2014-09-25
** Last Version:        V1.00
** Descriptions:        functions to manage T0 and T1 interrupts
** Correlated files:    timer.h
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#include <string.h>
#include "stdbool.h"
#include "lpc17xx.h"
#include "timer.h"
#include "../GLCD/GLCD.h" 
#include "../TouchPanel/TouchPanel.h"
#include "../variables.h"

/******************************************************************************
** Function name:		Timer0_IRQHandler
**
** Descriptions:		Timer/Counter 0 interrupt handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/

void TIMER0_IRQHandler (void)
{
	//static int clear = 0;
	//char time_in_char[5] = "";
	
  getDisplayPoint(&display, Read_Ads7846(), &matrix ) ;
	#ifdef SIMULATOR
	if(!start){
	#elif
	if(display.x <= 240 && display.x > 0 && display.y != 0){
	#endif
	if(display.x <= 240 && display.x > 0 && display.y < 317){
		
		startGame();
		game_init(); 
			
			
	}
	}
	else if (start){

		if((display.x <= 105 && display.x > 15) && (display.y >= 270 &&display.y < 300)){
		//restartGame
		restartGame();
		}
		else if((display.y >= 270 &&display.y < 300) && (display.x <= 225 && display.x > 135) && win==0){	
			//clear
			game_init();
		}
		}
		
	
  LPC_TIM0->IR = 1;			// clear interrupt flag 
  return;
}


/******************************************************************************
** Function name:		Timer1_IRQHandler
**
** Descriptions:		Timer/Counter 1 interrupt handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/
void TIMER1_IRQHandler (void)
{
  LPC_TIM1->IR = 1;			/* clear interrupt flag */
  return;
}

/******************************************************************************
**                            End Of File
******************************************************************************/
<file_sep>/*********************************************************************************************************
**--------------File Info---------------------------------------------------------------------------------
** File name:           IRQ_RIT.c
** Last modified Date:  2014-09-25
** Last Version:        V1.00
** Descriptions:        functions to manage T0 and T1 interrupts
** Correlated files:    RIT.h
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#include "lpc17xx.h"
#include "RIT.h"
#include "../variables.h"

/******************************************************************************
** Function name:		RIT_IRQHandler
**
** Descriptions:		REPETITIVE INTERRUPT TIMER handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/




void RIT_IRQHandler (void)
{					
	static int press=1;
	static int right=1;
	static int left=1;
	static int up=1;
	static int down=1;
		
		//PRESS
	if((LPC_GPIO1->FIOPIN & (1<<25)) == 0 && start){
		/* Joytick Select pressed */
		press++;
		switch(press){
			case 2:
				changeMode();
				break;
			default:
				break;
		}

	}	else{
		press=1;	
		}//DOWN
	if(((LPC_GPIO1->FIOPIN & (1<<26)) == 0) && ((LPC_GPIO1->FIOPIN & (1<<27)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<28)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<29)) != 0) && start){
	down++;
	switch(down%20){
		case 0:
			if(win==0){
			if(mode==1){
			direzione=3;
			buttonRun();
			drawBot();
			}
			
			else{
			direzione=3;
			drawBot();
			calc_distance();
			}
		}
			break;
			default:
			break;
	}	
		}
		else{
			down=1;
	}//LEFT
	if(((LPC_GPIO1->FIOPIN & (1<<26)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<27)) == 0) && ((LPC_GPIO1->FIOPIN & (1<<28)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<29)) != 0) && start){
	left++;
	switch(left%20){
		case 0:
			if(win==0){
			if(mode==1){
			direzione=2;
			buttonRun();
			drawBot();
	}else{
			direzione=2;			
			drawBot();
			calc_distance();
			}
		}
			break;
			default:
			break;
	}	
		}
		else{
			left=1;
	}//RIGHT
	if(((LPC_GPIO1->FIOPIN & (1<<26)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<27)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<28)) == 0) && ((LPC_GPIO1->FIOPIN & (1<<29)) != 0) && start){
	right++;
	switch(right%20){
		case 0:
			if(win==0){
			if(mode==1)	{
			direzione=0;
			buttonRun();
			drawBot();	}
			
			else{
			direzione=0;			
			drawBot();
			calc_distance();}
		}
			break;
		default:
			break;
	}
}
		else{
			right=1;
	}//UP
	if(((LPC_GPIO1->FIOPIN & (1<<26)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<27)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<28)) != 0) && ((LPC_GPIO1->FIOPIN & (1<<29)) == 0) && start){
	up++;
	switch(up%20){
		case 0:
			if(win==0){
			if(mode==1){
			direzione=1;
			buttonRun();
			drawBot();
			}else{
			direzione=1;			
			drawBot();
			calc_distance();			
			}
		}
			break;
		default:
			break;
	}	
		}
	else{
			up=1;
	}
	
	
	
  LPC_RIT->RICTRL |= 0x1;	/* clear interrupt flag */
	disable_RIT();
	init_RIT(1250000);	
	enable_RIT();
  return;
}

/******************************************************************************
**                            End Of File 
******************************************************************************/
<file_sep>/*********************************************************************************************************
**--------------File Info---------------------------------------------------------------------------------
** File name:           IRQ_timer.c
** Last modified Date:  2014-09-25
** Last Version:        V1.00
** Descriptions:        functions to manage T0 and T1 interrupts
** Correlated files:    timer.h
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
#include "lpc17xx.h"
#include "timer.h"
#include "../led/led.h"
#include "stdbool.h"
#include "../variables.h"
/******************************************************************************
** Function name:		Timer0_IRQHandler
**
** Descriptions:		Timer/Counter 0 interrupt handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/
extern unsigned char led_value;					/* defined in funct_led								*/
static bool led_zero = false;
void TIMER0_IRQHandler (void)
{

	if(win==1)
				{
			if(led_zero == 0)
						{	
						LED_Out(255);
						led_zero=1;
						}
					else
						{
						LED_Out(0);
						led_zero = 0;
						}
					}
	else {	
	switch(direzione){
				
				case 0:
					if(!led_zero)
						{	
						LED_On(2);
						led_zero=true;
						}
					else
						{
						LED_Off(2);
						led_zero = false;
						}
						break;
				case 1:
					if(!led_zero )
						{	
						LED_On(3);
						led_zero=true;
						}
					else
						{
						LED_Off(3);
						led_zero = false;
						}				
						break;					
				case 2:
					if(!led_zero)
						{	
						LED_On(0);
						led_zero=true;
						}
					else
						{
						LED_Off(0);
						led_zero = false;
						}
						break;
				case 3:
					if(!led_zero)
						{	
						LED_On(1);
						led_zero=true;
						}
					else
						{
						LED_Off(1);
						led_zero = false;
						}
						break;
	}
}
  LPC_TIM0->IR = 1;			/* clear interrupt flag */
  return;
}


/******************************************************************************
** Function name:		Timer1_IRQHandler
**
** Descriptions:		Timer/Counter 1 interrupt handler
**
** parameters:			None
** Returned value:		None
**
******************************************************************************/

void TIMER1_IRQHandler (void)
{
	/*
			conteggio++;
			if(conteggio % 10 && distance != 0 && button == 2)
				{
				if(led_running_acceso == 0)
				{	
				LED_On(led_running);
				led_running_acceso=1;
				}
				else
				{
				LED_Off(led_running);
				led_running_acceso = 0;
				}
				}
			else  LED_Off(led_running);
	*/
	/*
	LED_Off(led_running);
	disable_timer(1);
  LPC_TIM1->IR = 1;			// clear interrupt flag */
  
	return;
}

/******************************************************************************
**                            End Of File
******************************************************************************/
