-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.c
69 lines (50 loc) · 2.34 KB
/
sample.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*----------------------------------------------------------------------------
* Name: sample.c
* Purpose: to control led through debounced buttons and Joystick
* - key1 switches on the led at the left of the current led on,
* - it implements a circular led effect,
* - joystick select function returns to initial configuration (led11 on) .
* Note(s): this version supports the LANDTIGER Emulator
* Author: Paolo BERNARDI - 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 "joystick/joystick.h"
#include "TouchPanel/TouchPanel.h"
#include "GLCD/GLCD.h"
#include "gestioneSchermo/gestioneSchermo.h"
#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
/*----------------------------------------------------------------------------
Main Program
*----------------------------------------------------------------------------*/
int main (void) {
SystemInit(); /* System Initialization (i.e., PLL) */
LED_init(); /* LED Initialization */
BUTTON_init(); /* BUTTON Initialization */
joystick_init(); /* Joystick Initialization */
LCD_Initialization();
TP_Init();
//inizializzaSchermo();
LCD_Clear(Blue);
init_RIT(0x004C4B40); /* RIT Initialization 50 msec */
enable_RIT(); /* RIT enabled */
init_timer(0,0x004C4B40);
enable_timer(0);
//LED_On(0);
LPC_SC->PCON |= 0x1; /* power-down mode */
LPC_SC->PCON &= ~(0x2);
while (1) { /* Loop forever */
__ASM("wfi");
}
}