-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
82 lines (69 loc) · 2.06 KB
/
main.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
77
78
79
80
#include "QSKDefines.h"
#include "proto.h"
#include "extern.h"
#include "car_defines.h"
/***********************************************************************/
/* */
/* File Name: main.c */
/* DATE :2/26/2012 */
/* */
/* DESCRIPTION : This file contains MAIN */
/* */
/* */
/* CPU GROUP :M16C */
/* */
/* Modified By: Peter Panburana (ppanbur) */
/* Version 1.1 (3/5/2012) */
/* */
/***********************************************************************/
//Defines go here
#define PRESSED 0
#define TRUE 1
int disp_count; // LED control variable
uint A2DValue;
uint A2DValuePot;
uint A2DValueTherm;
uchar A2DProcessed;
void main(void)
//-----------------------------------------------------------------------------------------------------
// Purpose: The MCU will come here after reset.
//
//
// Rev: 1.5a TEMPLATE RELEASE
//
// Notes: None
//-----------------------------------------------------------------------------------------------------
{
//Initialization function calls
init_ports();
motors_init();
system_clock_init();
InitDisplay("FHBTEST "); //Start-up splash changed to unity ID
InitUART();
ADInit();
ENABLE_SWITCHES;
/* LED initialization - macro defined in qsk_bsp.h */
ENABLE_LEDS
//Polling for switch presses
while(TRUE)
{
if(S1 == PRESSED)
{
BNSPrintf(LCD,"\tTEST \n ");
project2ADemo();
}
else if (S2 == PRESSED)
{
BNSPrintf(LCD,"\tOff \n ");
}
else if (S3 == PRESSED)
{
BNSPrintf(LCD,"\tFigure 8 \n ");
DoFigureEight();
}
else
{
BNSPrintf(LCD,"\tTeam 2 \n ");
}
}
}