1 | int main (void)
|
2 | {
|
3 | uint8_t tmp_SPSR; // temporärer Speicher für Statusregister
|
4 |
|
5 | MMC_IO_Init();
|
6 |
|
7 | tmp_SPSR = SPSR; // Statusregister sichern
|
8 | cli(); // Interrupts global deaktivieren
|
9 | // damit Methode nicht unterbrochen wird
|
10 | SPI_Init(); // Init DisplayInterface
|
11 |
|
12 | SPSR = tmp_SPSR; // Statusregister wieder herstellen
|
13 | sei();
|
14 |
|
15 |
|
16 | _delay_ms(100);
|
17 |
|
18 | while (DISPLAY_BUSY) {nop(); }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | tmp_SPSR = SPSR; // Statusregister sichern
|
24 | cli(); // Interrupts global deaktivieren
|
25 | // damit Methode nicht unterbrochen wird
|
26 |
|
27 | SetPenColor(0, 0, 0); // Pen Color black
|
28 | SetBrushColor(255, 255, 255);// Brush Color white
|
29 | SetFont(1); // Text and Number Font 1
|
30 |
|
31 | FillScreen_BrushColor();
|
32 | // DebugMode(1); // DebugMode on
|
33 | SetBacklightIntensity(255); // Backlight brightness 100%
|
34 |
|
35 | DisplayText_F(65, 140, PSTR("xv-display.de"));
|
36 |
|
37 | SPSR = tmp_SPSR; // Statusregister wieder herstellen
|
38 | sei();
|
39 |
|
40 | if(GetDriveInformation()!=F_OK) // get drive parameters
|
41 | {
|
42 |
|
43 | // Gib hier eine Fehlermeldung raus
|
44 | tmp_SPSR = SPSR; // Statusregister sichern
|
45 | cli(); // Interrupts global deaktivieren
|
46 | // damit Methode nicht unterbrochen wird
|
47 |
|
48 | DisplayText_F(65, 140, PSTR("FEHLER"));
|
49 |
|
50 | SPSR = tmp_SPSR; // Statusregister wieder herstellen
|
51 | sei();
|
52 | while(1);
|
53 | }
|
54 |
|
55 | tmp_SPSR = SPSR; // Statusregister sichern
|
56 | cli(); // Interrupts global deaktivieren
|
57 | // damit Methode nicht unterbrochen wird
|
58 |
|
59 | DisplayText_F(65, 140, PSTR(" ok "));
|
60 |
|
61 | SPSR = tmp_SPSR; // Statusregister wieder herstellen
|
62 | sei();
|
63 |
|
64 |
|
65 | while (1)
|
66 | {
|
67 | /*
|
68 | SetPenColor(0, 0, 0); // Pen Color black
|
69 | SetBrushColor(255, 255, 255);// Brush Color white
|
70 | SetFont(1); // Text and Number Font 1
|
71 | SetBacklightIntensity(255); // Backlight brightness 100%
|
72 |
|
73 | FillScreen_BrushColor();
|
74 | DisplayText_F(70, 120, PSTR("xv-display.de"));
|
75 | DisplayText_F(65, 140, PSTR("Display Module"));
|
76 | SetFont(0);
|
77 | DisplayText_F(15, 160, PSTR("Demonstration of Instruction Set"));
|
78 | SetFont(1);
|
79 |
|
80 | _delay_ms(5000);
|
81 |
|
82 |
|
83 | Demo_System();
|
84 | Demo_TextGlobal();
|
85 | Demo_Graphics();
|
86 | Demo_Numerical();
|
87 | Demo_TouchPanel();
|
88 | Demo_UserMemory();
|
89 |
|
90 |
|
91 | DrawRect_BrushColorFill(0, 0, 239, 319);
|
92 | DisplayText_F(5, 5, PSTR("Repeating Demonstration ..."));
|
93 | _delay_ms(2000);
|
94 | */
|
95 |
|
96 | }
|
97 |
|
98 |
|
99 |
|
100 | return 0;
|
101 | }
|