-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.c
53 lines (46 loc) · 1.99 KB
/
init.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
//------------------------------------------------------------------------------
//
// Description: This file contains the initializing fucntion
//
//
// Cameron Koegel
// Jan 2020
// Built with IAR Embedded Workbench Version: V7.12.4
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include "functions.h"
#include "msp430.h"
#include "macros.h"
// Function Prototypes
void Init_Conditions(void);
// Global Variables
extern char display_line[DISP_ROW_FOUR][DISP_COL_ELEVEN];
extern char *display[DISP_ROW_FOUR];
extern volatile unsigned char display_changed;
extern volatile unsigned char update_display;
extern volatile unsigned int update_display_count;
extern volatile unsigned int Time_Sequence;
extern volatile char one_time;
void Init_Conditions(void){
//------------------------------------------------------------------------------
int i;
for(i=DISP_ROW_ZERO;i<DISP_COL_ELEVEN;i++){
display_line[DISP_ROW_ZERO][i] = RESET_STATE;
display_line[DISP_ROW_ONE][i] = RESET_STATE;
display_line[DISP_ROW_TWO][i] = RESET_STATE;
display_line[DISP_ROW_THREE][i] = RESET_STATE;
}
display_line[DISP_ROW_ZERO][DISP_COL_TEN] = DISP_ROW_ZERO;
display_line[DISP_ROW_ONE][DISP_COL_TEN] = DISP_ROW_ZERO;
display_line[DISP_ROW_TWO][DISP_COL_TEN] = DISP_ROW_ZERO;
display_line[DISP_ROW_THREE][DISP_COL_TEN] = DISP_ROW_ZERO;
display[DISP_ROW_ZERO] = &display_line[DISP_ROW_ZERO][DISP_ROW_ZERO];
display[DISP_ROW_ONE] = &display_line[DISP_ROW_ONE][DISP_ROW_ZERO];
display[DISP_ROW_TWO] = &display_line[DISP_ROW_TWO][DISP_ROW_ZERO];
display[DISP_ROW_THREE] = &display_line[DISP_ROW_THREE][DISP_ROW_ZERO];
update_display = DISP_ROW_ZERO;
update_display_count = DISP_ROW_ZERO;
// Interrupts are disabled by default, enable them.
enable_interrupts();
//------------------------------------------------------------------------------
}