-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMewPro_Iliad.ino
54 lines (44 loc) · 1.23 KB
/
MewPro_Iliad.ino
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
#include "Iliad.h"
void setup()
{
SERIAL.begin(57600); // baud rate ignored for USB virtual serial
ROM_Read();
// setup LCD
initLCD();
// setup IR remote
initIRremote();
// momentary switches
initSwitch();
// RTC
initRTC();
StopSyncSignal(); // initialize timer
#if defined(__AVR_ATmega2560__)
BROADCAST.begin(57600); // 57600 is the fastest communication rate for AVR8 8MHz 3.3V on MewPro boards
BROADCAST_UART_RECEIVER_DISABLE;
#endif
digitalWrite(SECONDARY_RESET, LOW);
pinMode(SECONDARY_RESET, OUTPUT);
delay(1000);
pinMode(SECONDARY_RESET, INPUT_PULLUP);
digitalWrite(TRIG, LOW); // unused. fix LOW to reduce noise
pinMode(TRIG, OUTPUT);
}
void loop()
{
// start up sessions
if (startupSession != STARTUP_HALT) {
if (startup[startupSession] != NULL) {
if ((startup[startupSession])()) { // call the function
startupSession++; // one function completed
}
} else {
__emptyInputBuffer();
startupSession = STARTUP_HALT;
updateLCD();
}
}
checkTerminalCommands(); // a finite state machine
checkIRremoteCommands(); // CUI: IR remote
checkSwitchCommands(); // CUI: momentary switch
checkGenlockState(); // start/stop genlock signals
}