-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbbsDisplay.ino
79 lines (64 loc) · 1.24 KB
/
bbsDisplay.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
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
#include "gfx.h"
#include "clock.h"
#include "storage.h"
#include "comm.h"
#include "ctrl.h"
const int RXLED = 17;
unsigned int loopCnt=0;
void setup() {
Serial.begin(9600);
Comm_Init();
pinMode(RXLED, OUTPUT);
Gfx_Init();
RTC_Init();
Storage_Init();
Ctrl_Init();
//RTC_ReadTime_UTC();
//RTC_WriteTime_UTC(2018,6,9,11,55,0);
//RTC_WriteTime_UTC(2017,RTC.mm,RTC.dd,RTC.h,RTC.m,RTC.s);
//Timer0 1ms interrupt
OCR0A = 0xAF;
TIMSK0 |= _BV(OCIE0A);
sei();
}
SIGNAL(TIMER0_COMPA_vect)
{
Ctrl_Tick();
Comm_Tick();
}
void DoBlink() {
if(loopCnt%2)
{
digitalWrite(RXLED, LOW); // set the LED on
TXLED1;
}
else
{
digitalWrite(RXLED, HIGH); // set the LED off
TXLED0; //TX LED is not tied to a normally controlled pin
}
}
void Test()
{
//ClearRAM();
//DumpRAM();
//DumpROM();
//Storage_Init();
//int w=Serial1.availableForWrite();
//Serial.println(w);
}
void loop()
{
loopCnt++;
//DoBlink();
//Serial.println("Hello!");delay(1000);return;
RTC_ReadTime_Local();
Storage_Tick();
Gfx_Render();
delay(50);
//if(loopCnt==5) iBatVolt=54800;
//if(loopCnt==100) iBatVolt=46100;
//if(loopCnt==20) Test();
if(loopCnt%10==2) Serial.println(iThrottle);
if(loopCnt%10==2) Serial.println(iPushState);
}