-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterrupts.c
64 lines (56 loc) · 1.5 KB
/
interrupts.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
/*
* ==== DO NOT MODIFY THIS FILE - CHANGES WILL BE OVERWRITTEN ====
*
* Generated from
* C:/ti/grace/grace_1_10_03_31_eng/packages/ti/mcu/msp430/csl/system/System_init.xdt
*/
#include <msp430.h>
/*
* ======== System_init ========
* Initialize MSP430 Status Register
*/
void System_init(void)
{
/* Clear oscillator fault flag with software delay */
do
{
// Clear OSC fault flag
IFG1 &= ~OFIFG;
// 50us delay
__delay_cycles(800);
} while (IFG1 & OFIFG);
/*
* IFG2, Interrupt Flag Register 2
*
* UCB0TXIFG -- Interrupt pending
* UCB0RXIFG -- Interrupt pending
* ~UCA0TXIFG -- No interrupt pending
* UCA0RXIFG -- Interrupt pending
*
* Note: ~UCA0TXIFG indicates that UCA0TXIFG has value zero
*/
IFG2 &= ~(UCB0TXIFG + UCB0RXIFG + UCA0RXIFG);
/*
* IE2, Interrupt Enable Register 2
*
* UCB0TXIE -- Interrupt enabled
* UCB0RXIE -- Interrupt enabled
* ~UCA0TXIE -- Interrupt disabled
* UCA0RXIE -- Interrupt enabled
*
* Note: ~UCA0TXIE indicates that UCA0TXIE has value zero
*/
IE2 |= UCB0TXIE + UCB0RXIE + UCA0RXIE;
/*
* SR, Status Register
*
* ~SCG1 -- Disable System clock generator 1
* ~SCG0 -- Disable System clock generator 0
* ~OSCOFF -- Oscillator On
* ~CPUOFF -- CPU On
* GIE -- General interrupt enable
*
* Note: ~<BIT> indicates that <BIT> has value zero
*/
__bis_SR_register(GIE);
}