-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
47 lines (38 loc) · 1011 Bytes
/
main.cpp
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
/*
* main.cpp
*
* Created on: Jul 8, 2019
* Author: vqtrong
*
* MIT License
*/
#include <stdint.h>
#include "BuildConfig.h"
#include "System/SystemControl.h"
#include "Utils/CpuUsage.h"
#include "Logger/Logger.h"
void main()
{
// should disable system interrupt while configuring our interrupts
DisableInterrupts();
// MUST initialize system first, which config the SYSTEM CLOCK to 80MHz
InitSystem();
// start to run
Logger::getInstance().print("\033[2J"); // clear screen
#if USE_SLEEP_MODE
Logger::getInstance().println("\n\rSleep Mode: ON");
#else
Logger::getInstance().println("\n\rSleep Mode: Off");
#endif
Logger::getInstance().println(HW_VERSION);
Logger::getInstance().println(SW_VERSION);
// start CPU Usage
CpuUsage::getInstance();
// run main program by enable interruptions
EnableInterrupts();
while (true)
{
// put cpu to low power mode, and wait for an interruption
WaitForInterrupt();
}
}