-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4af58a4
commit 0463a16
Showing
38 changed files
with
25,773 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<html> | ||
<body> | ||
<pre> | ||
<h1>µVision Build Log</h1> | ||
<h2>Tool Versions:</h2> | ||
IDE-Version: µVision V5.24.2.0 | ||
Copyright (C) 2017 ARM Ltd and ARM Germany GmbH. All rights reserved. | ||
License Information: Carlos Peña, Politecnico, LIC=---- | ||
|
||
Tool Versions: | ||
Toolchain: MDK-Lite Version: 5.24.1 | ||
Toolchain Path: C:\Keil_P\ARM\ARMCC\Bin | ||
C Compiler: Armcc.exe V5.06 update 5 (build 528) | ||
Assembler: Armasm.exe V5.06 update 5 (build 528) | ||
Linker/Locator: ArmLink.exe V5.06 update 5 (build 528) | ||
Library Manager: ArmAr.exe V5.06 update 5 (build 528) | ||
Hex Converter: FromElf.exe V5.06 update 5 (build 528) | ||
CPU DLL: SARMCM3.DLL V5.24.1 | ||
Dialog DLL: DARMP1.DLL V1.27.0.0 | ||
Target DLL: UL2CM3.DLL V1.160.3.0 | ||
Dialog DLL: TARMP1.DLL V1.26.0.0 | ||
|
||
<h2>Project:</h2> | ||
C:\Users\Roberth\Documents\11 Polito 1\Computer Arquitectures\Proyecto\Escritorio\Snake (20Mayo2018)\Snake\sample.uvprojx | ||
Project File Date: 03/07/2018 | ||
|
||
<h2>Output:</h2> | ||
*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_P\ARM\ARMCC\Bin' | ||
Rebuild target 'Target 1' | ||
assembling startup_LPC17xx.s... | ||
compiling core_cm3.c... | ||
compiling sample.c... | ||
compiling system_LPC17xx.c... | ||
compiling IRQ.c... | ||
compiling GLCD_SPI_LPC1700.c... | ||
compiling lib_button.c... | ||
compiling IRQ_button.c... | ||
compiling IRQ_potenciometer.c... | ||
compiling Lib_potenciometer.c... | ||
compiling joystick.c... | ||
compiling funct_timer.c... | ||
compiling IRQ_timer.c... | ||
compiling lib_timer.c... | ||
compiling lib_movement.c... | ||
compiling menu.c... | ||
linking... | ||
Program Size: Code=13546 RO-data=6542 RW-data=276 ZI-data=836 | ||
".\sample.axf" - 0 Error(s), 0 Warning(s). | ||
|
||
<h2>Software Packages used:</h2> | ||
|
||
Package Vendor: ARM | ||
http://www.keil.com/pack/ARM.CMSIS.5.2.0.pack | ||
ARM.CMSIS.5.2.0 | ||
CMSIS (Cortex Microcontroller Software Interface Standard) | ||
* Component: CORE Version: 5.0.2 | ||
|
||
Package Vendor: Keil | ||
http://www.keil.com/pack/Keil.LPC1700_DFP.2.4.0.pack | ||
Keil.LPC1700_DFP.2.4.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:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include | ||
C:\Keil_P\ARM\PACK\Keil\LPC1700_DFP\2.4.0\Device\Include | ||
|
||
<h2>Collection of Component Files used:</h2> | ||
|
||
* Component: ARM::CMSIS:CORE:5.0.2 | ||
Build Time Elapsed: 00:00:09 | ||
</pre> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/*---------------------------------------------------------------------------- | ||
* Name: sample.c | ||
* Purpose: SnakeGame implementation | ||
*---------------------------------------------------------------------------- | ||
* Computer Architectures Special Project | ||
*Copyright (c) 2018 Politecnico di Torino. All rights reserved. | ||
*---------------------------------------------------------------------------- | ||
*Carlos José Peña Agreda [email protected] | ||
*Roberth Reynel Rosero Osorio [email protected]*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "LPC17xx.H" /* LPC17xx definitions */ | ||
#include "button_EXINT/button.h" /*library containing the interrupts of the buttons*/ | ||
#include "potenciometer/potenciometer.h"/*library containing the potenciometer functions and interrupts*/ | ||
#include "timer/timer.h" /*library containing the timer interrupts functions*/ | ||
#include "GLCD.h"/*library used for the control of the display*/ | ||
#include "movement/movement.h"/*library used for the control of the snake*/ | ||
#include "menu/menu.h"/*library used for the grafical interface*/ | ||
|
||
|
||
/* definition of all global variables */ | ||
|
||
int x=100, //x and y are the variables used for the position of the snake | ||
y=100, | ||
direction = 1,//this variables is the direction of the snake | ||
x1=100,// x1, x2, y1,y2 are the additional variables used for the tail of the snake | ||
y1=100, | ||
x2=100, | ||
y2=100, | ||
delay = 60, | ||
lvl, // level of the difficulty | ||
index_color_game = 6, //index used for the color of the background of the game | ||
index_color_snake = 12;// index used for the color of the snale | ||
char point_char[10][5]={"00","01","02","03","04","05","06","07","08","09"};// string used for priting the currents points of the user | ||
int points = 0; | ||
|
||
char levels[4][10] = {" CA's "," Expert ","Beginner"," Dummy "}; //string used for printing the current level of the game | ||
int colors[]={0x0000,0x000F,0x03E0,0x03EF,0x7800,0x780F,0x7BE0,0xC618, | ||
0x7BEF,0x001F,0x07E0,0x07FF,0xF800,0xF81F,0xFFE0,0xFFFF};// string containing the diferent values of the color | ||
extern uint32_t ADC_result;//value obtained with the potenciomenter | ||
|
||
/* the ClockRefresh variables are variables used for the counting the number of ticks in that the system has been running | ||
the differet variables are for different number of ticks. This is used of the difficulty. The faster the snake the less ticks the | ||
variable counts */ | ||
|
||
extern char ClockRefresh0; | ||
extern char ClockRefresh1; | ||
extern char ClockRefresh2; | ||
extern char ClockRefresh3; | ||
extern char ClockTicks; | ||
|
||
/*---------------------------------------------------------------------------- | ||
Main Program | ||
*----------------------------------------------------------------------------*/ | ||
int main (void) { | ||
|
||
SystemInit(); /* System Initialization (i.e., PLL) */ | ||
GLCD_Init(); /* Initiate the GLCD screen */ | ||
BUTTON_init(); /* BUTTON Initialization */ | ||
init_timer(0,0x17D7840); /* Timer initiation with 1 second duration*/ | ||
Potenciometer_init(); /* Potentiometer initiation */ | ||
|
||
opening(); //show the title | ||
|
||
complete_menu();//function where all the menu are configurated | ||
|
||
SysTick_Config(SystemCoreClock/100); /*Every 10ms will be an interruption (SCC = 10kHz)*/ | ||
|
||
|
||
|
||
while (1) { /* Loop forever */ | ||
/*With this part of the code we display the always the level and the | ||
points when the game is running*/ | ||
GLCD_DisplayString(0,19,0,(unsigned char*)"Level: "); | ||
GLCD_DisplayString(0,26,0,(unsigned char*) levels[lvl]); | ||
GLCD_DisplayString(25,20,0,(unsigned char*)"points:"); | ||
GLCD_DisplayString(25,27,0,(unsigned char*)point_char[points]); | ||
if(ClockTicks){ | ||
ClockTicks=0; | ||
direction_change();/*Allows the snake to change the | ||
dorections*/ | ||
} | ||
/*With the colition we evaluate if the snake have "eated" a | ||
piece of "food in the game"*/ | ||
colition(); | ||
/*With the following switch we control de speed of the | ||
game depending on the selected level before*/ | ||
switch(lvl){// depending on the level we use diferent ClockRefresh to call the function more frequently or less frequently | ||
case 0: if(ClockRefresh0){ClockRefresh0=0;movement();} | ||
case 1: if(ClockRefresh1){ClockRefresh1=0;movement();} | ||
case 2: if(ClockRefresh2){ClockRefresh2=0;movement();} | ||
case 3: if(ClockRefresh3){ClockRefresh3=0;movement();} | ||
} | ||
} | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.\sample.o: sample.c | ||
.\sample.o: C:\Keil_P\ARM\ARMCC\Bin\..\include\stdio.h | ||
.\sample.o: C:\Keil_P\ARM\ARMCC\Bin\..\include\stdlib.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\Keil\LPC1700_DFP\2.4.0\Device\Include\LPC17xx.H | ||
.\sample.o: C:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include\core_cm3.h | ||
.\sample.o: C:\Keil_P\ARM\ARMCC\Bin\..\include\stdint.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include\cmsis_version.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include\cmsis_compiler.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include\cmsis_armcc.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\ARM\CMSIS\5.2.0\CMSIS\Include\mpu_armv7.h | ||
.\sample.o: C:\Keil_P\ARM\PACK\Keil\LPC1700_DFP\2.4.0\Device\Include\system_LPC17xx.h | ||
.\sample.o: button_EXINT/button.h | ||
.\sample.o: potenciometer/potenciometer.h | ||
.\sample.o: timer/timer.h | ||
.\sample.o: GLCD.h | ||
.\sample.o: movement/movement.h | ||
.\sample.o: menu/menu.h |
Oops, something went wrong.