-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.cpp
More file actions
100 lines (80 loc) · 1.47 KB
/
Copy pathkernel.cpp
File metadata and controls
100 lines (80 loc) · 1.47 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//
// kernel.cpp
//
// based on Circle's examples
#include "kernel.h"
#include <circle/machineinfo.h>
#include <assert.h>
static const char FromKernel[] = "kernel";
CKernel::CKernel (void)
: m_Screen (m_Options.GetWidth (), m_Options.GetHeight (), Font12x22, CCharGenerator::FontFlagsDoubleBoth),
m_Logger (m_Options.GetLogLevel ()),
m_Timer (&m_Interrupt),
m_I2CMaster(CMachineInfo::Get()->GetDevice(DeviceI2CMaster), true),
m_SDLoader(&m_Interrupt, &m_Timer),
m_LutSynth(&m_I2CMaster, &m_Interrupt, &m_SDLoader)
{
m_ActLED.Blink (1); // show we are alive
}
CKernel::~CKernel (void)
{
}
boolean CKernel::Initialize (void)
{
boolean bOK = TRUE;
if (bOK)
{
bOK = m_Screen.Initialize ();
}
if (bOK)
{
CDevice *pTarget = m_DeviceNameService.GetDevice (m_Options.GetLogDevice (), FALSE);
if (pTarget == 0)
{
pTarget = &m_Screen;
}
bOK = m_Logger.Initialize (pTarget);
}
if (bOK)
{
bOK = m_Interrupt.Initialize ();
}
if (bOK)
{
bOK = m_Timer.Initialize ();
}
if (bOK)
{
bOK = m_I2CMaster.Initialize ();
}
if (bOK)
{
bOK = m_SDLoader.Initialize();
}
if (bOK)
{
bOK = m_LutSynth.Initialize ();
}
if (bOK)
{
bOK = m_SDLoader.LoadPatches();
}
if (bOK)
{
bOK = m_LutSynth.InitPatches();
}
if (bOK)
{
bOK = m_LutSynth.StartSoundDevice();
}
return bOK;
}
TShutdownMode CKernel::Run (void)
{
CLogger::Get ()->Write(FromKernel, LogNotice, "INIT OK");
while (TRUE)
{
m_LutSynth.Process ();
}
return ShutdownHalt;
}