-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patharm7_main.c
67 lines (52 loc) · 1.24 KB
/
arm7_main.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
65
66
67
// SPDX-License-Identifier: ZPL-2.1
// SPDX-FileCopyrightText: Copyright fincs, devkitPro
#include <calico.h>
#ifdef ENABLE_MAXMOD
#include <maxmod7.h>
#endif
int main(int argc, char* argv[])
{
// Read settings from NVRAM
envReadNvramSettings();
// Set up extended keypad server (X/Y/hinge)
keypadStartExtServer();
// Configure and enable VBlank interrupt
lcdSetIrqMask(DISPSTAT_IE_ALL, DISPSTAT_IE_VBLANK);
irqEnable(IRQ_VBLANK);
// Set up RTC
rtcInit();
rtcSyncTime();
// Initialize power management
pmInit();
#ifdef ENABLE_LOG
// Set up ARM7->ARM9 debug output
dietPrintSetFunc(debugOutput);
dietPrint("[ARM7] Component start\n");
#endif
#ifdef ENABLE_BLKDEV
// Set up block device peripherals
blkInit();
#endif
// Set up touch screen driver
touchInit();
touchStartServer(80, MAIN_THREAD_PRIO);
#ifdef ENABLE_SOUND
// Set up sound and mic driver
soundStartServer(MAIN_THREAD_PRIO-0x10);
micStartServer(MAIN_THREAD_PRIO-0x18);
#endif
// TODO: Set up camera driver
#ifdef ENABLE_WLMGR
// Set up wireless manager
wlmgrStartServer(MAIN_THREAD_PRIO-8);
#endif
#ifdef ENABLE_MAXMOD
// Set up Maxmod
mmInstall(MAIN_THREAD_PRIO+1);
#endif
// Main loop (mostly idle)
while (pmMainLoop()) {
threadWaitForVBlank();
}
return 0;
}