-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (28 loc) · 720 Bytes
/
main.cpp
File metadata and controls
45 lines (28 loc) · 720 Bytes
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
#include "msp430g2553.h"
#include "softUart.h"
#include "globals.h"
#include "timer.h"
#define BUTTON BIT3
char btnpress;
unsigned char check;
char value;
/*
* main.c
*/
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
if (CALDCO_16MHZ == 0xFF) // If calibration constant erased
{
while (1)
; // do not load, trap CPU!!
}
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_16MHZ; // Set DCO
DCOCTL = CALBC1_16MHZ;
initClockTime();
//endbtn
btnpress = 0;
softUart su;
_BIS_SR(GIE); // Enable CPU interrupts
su.xmit("\n\rSoftware UART\n\r");
}