-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
81 lines (50 loc) · 2.33 KB
/
main.c
File metadata and controls
81 lines (50 loc) · 2.33 KB
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
81
/**********************************************************************
File name: main.c
Main program file for the car
**********************************************************************/
/************************ Revision History ****************************
YYYY-MM-DD Checksum Comments
-------------------------------------------------------------------------------------------
2009-04-08 First release.
2019-06-28 Documentation updated
************************************************************************/
#include "small_car-efwd-01.h"
#include "io430.h"
#include "typedef_MSP430.h"
#include "intrinsics.h"
#include "main.h"
/************************ External Program Globals ****************************/
/* Globally available variables from other files as indicated */
extern fnCode_type CarStateMachine; /* From blink-efwd-01.c */
extern fnCode_type G_fCurrentStateMachine; /* From blink-efwd-01.c */
extern fnCode_type G_pfPatterns[]; /* From blink-efwd-01.c */
extern volatile u16 u16GlobalRuntimeFlags; /* From blink-efwd-01.c */
extern volatile u16 u16GlobalErrorFlags; /* From blink-efwd-01.c */
extern volatile u8 u8GlobalCurrentSleepInterval; /* From blink-efwd-01.c */
/************************ Program Globals ****************************/
/* Global variable definitions intended for scope of multiple files */
/************************ Main Program ****************************/
/* From cstartup.s43, the processor is running from the ACLK, TimerA is running, and I/O lines have been configured. */
int main(void)
{
/* Enter the state machine where the program will remain unless power cycled */
__bis_SR_register(GIE);
while(1)
{
CarStateMachine();
}
} /* end main */
/************************ Interrupt Service Routines ****************************/
/*----------------------------------------------------------------------------*/
#pragma vector = TIMER0_A1_VECTOR
__interrupt void TimerAISR(void)
{
/* Handles waking up from low power mode via TimerA expiration and returns with processor awake */
//u8GlobalCurrentSleepInterval = SLEEP_TIME;
TACTL = TIMERA_INT_DISABLE;
asm("BIC #0x0010,0(SP)");
} // end timer_wakeup_isr
#pragma vector = ADC10_VECTOR
__interrupt void adc10_interrupt(void)
{
}