-
Notifications
You must be signed in to change notification settings - Fork 0
/
uMidiSaver.ino
56 lines (35 loc) · 946 Bytes
/
uMidiSaver.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
54
#include <EEPROM.h>
#include "UI.h"
// #include "HardwareSerial.h"
#include <ChibiOS_AVR.h>
#include <SdFat.h>
#include "SSMidi.h"
//------------------------------------------------------------------------------
// Thread 1, manage the serial and midi saving
// 128 byte stack beyond task switch and interrupt needs
static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
ss_comm_daemon();
return 0;
}
// static WORKING_AREA(waThread2, 128);
static msg_t Thread2(void *arg) {
InitUI();
RunUI();
return 0;
}
//------------------------------------------------------------------------------
// main thread runs at NORMALPRIO
void setup() {
cli();
halInit();
chSysInit();
// start deamon thread
Thread *t1 = chThdCreateStatic(waThread1, sizeof(waThread1),
NORMALPRIO , Thread1, NULL);
//main thread handle the UI
InitUI();
RunUI();
}
void loop() {
}