-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.c
76 lines (59 loc) · 2.3 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
70
71
72
73
74
75
76
/****************************************Copyright (c)****************************************************
**
** http://www.powermcu.com
**
**--------------File Info---------------------------------------------------------------------------------
** File name: main.c
** Descriptions: The GLCD application function
**
**--------------------------------------------------------------------------------------------------------
** Created by: AVRman
** Created date: 2010-11-7
** Version: v1.0
** Descriptions: The original version
**
**--------------------------------------------------------------------------------------------------------
** Modified by: Paolo Bernardi
** Modified date: 03/01/2020
** Version: v2.0
** Descriptions: basic program for LCD and Touch Panel teaching
**
*********************************************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "time.h"
#include "LPC17xx.h"
#include "GLCD/GLCD.h"
#include "timer/timer.h"
#include "RIT/RIT.h"
#include "TouchPanel/TouchPanel.h"
#include "game/game.h"
#include "button_EXINT/button.h"
#include "joystick/joystick.h"
#include "adc/adc.h"
#define SIMULATOR 1
#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 main(void)
{
SystemInit(); /* System Initialization (i.e., PLL) */
LCD_Initialization();
TP_Init();
TouchPanel_Calibrate();
BUTTON_init();
joystick_init();
ADC_init();
game_world_setup();
LPC_SC->PCON |= 0x1; /* power-down mode */
LPC_SC->PCON &= ~(0x2);
LPC_PINCON->PINSEL1 |= (1<<21);
LPC_PINCON->PINSEL1 &= ~(1<<20);
LPC_GPIO0->FIODIR |= (1<<26);
while (1)
{
__ASM("wfi");
}
}
/*********************************************************************************************************
END FILE
*********************************************************************************************************/