WIP
прошивка по записи RTC для старых часов rally
This commit is contained in:
@@ -27,9 +27,6 @@ unsigned long TMR_FPS;
|
||||
long FPS;
|
||||
|
||||
bool LCD_Simple_clock;
|
||||
bool GPS_PPS_LCD, RTC_SQW_LCD;
|
||||
volatile bool fGPS_PPS, fRTC_SQW;
|
||||
|
||||
|
||||
void setup() { // the setup function runs once when you press reset or power the board
|
||||
// LCD
|
||||
@@ -38,7 +35,10 @@ void setup() { // the setup function runs once when you
|
||||
lcd.backlight();
|
||||
lcd.setCursor(0,0);
|
||||
lcd.print("DEBUG[setup()]");
|
||||
delay(500);
|
||||
DEBUG_PORT.begin(38400);
|
||||
DEBUG_PORT.flush();
|
||||
delay(1000);
|
||||
DEBUG_PORT.println("DEBUG[setup()]");
|
||||
//Serial.begin(19200); // = 9600, must be same as GPS for debug
|
||||
//Serial.println(); // flush serial
|
||||
//Serial.println("-Arduino Reboot-"); // debug
|
||||
@@ -63,12 +63,12 @@ void loop() { // the loop function runs over and over again forever
|
||||
GPS_RTC_Clock_loop(); // first in loop
|
||||
|
||||
RTCtoLCD();
|
||||
chkFPS();
|
||||
//chkFPS();
|
||||
}
|
||||
|
||||
/////////////////////
|
||||
void RTCtoLCD() {
|
||||
if (GPS_sec) {
|
||||
/*if (GPS_sec) {
|
||||
DEBUG_PORT.println("DEBUG[RTCtoLCD] GPS_sec");
|
||||
GPS_PPS_LCD = !GPS_PPS_LCD;
|
||||
lcd.setCursor(2, 0);
|
||||
@@ -79,7 +79,7 @@ void RTCtoLCD() {
|
||||
RTC_SQW_LCD = !RTC_SQW_LCD;
|
||||
lcd.setCursor(5, 0);
|
||||
lcd.print((RTC_SQW_LCD) ? " " : ":");
|
||||
}
|
||||
}*/
|
||||
//if (!GPS_sec and !RTC_sec) return;
|
||||
if (!NewSec && !NewMin && !NewHour) return;
|
||||
char Clock[9];
|
||||
@@ -88,19 +88,22 @@ void RTCtoLCD() {
|
||||
|
||||
if (NewSec) {
|
||||
DEBUG_PORT.println("DEBUG[RTCtoLCD] newSec");
|
||||
DEBUG_PORT.println("DEBUG[RTCtoLCD] RTCMillis: " + String(RTCMillis));
|
||||
DEBUG_PORT.println("DEBUG[RTCtoLCD] RTC_sec: " + String(RTC_sec));
|
||||
DEBUG_PORT.println("DEBUG[RTCtoLCD] millis: " + String(millis()));
|
||||
snprintf(segment, sizeof(segment),"%.2u", second(Loc_t));
|
||||
//DEBUG_PORT.println("DEBUG[RTCtoLCD] RTCMillis: " + String(RTCMillis));
|
||||
//DEBUG_PORT.println("DEBUG[RTCtoLCD] RTC_sec: " + String(RTC_sec));
|
||||
//DEBUG_PORT.println("DEBUG[RTCtoLCD] millis: " + String(millis()));
|
||||
//snprintf(segment, sizeof(segment),"%.2u", second(Loc_t));
|
||||
snprintf(segment, sizeof(segment),"%.2u", second(RTC_t));
|
||||
lcd.setCursor(6, 0);
|
||||
lcd.print(segment);
|
||||
}
|
||||
|
||||
if (NewMin) {
|
||||
snprintf(segment, sizeof(segment),"%.2u", minute(Loc_t));
|
||||
//snprintf(segment, sizeof(segment),"%.2u", minute(Loc_t));
|
||||
snprintf(segment, sizeof(segment),"%.2u", minute(RTC_t));
|
||||
lcd.setCursor(3, 0);
|
||||
lcd.print(segment);
|
||||
snprintf(segment, sizeof(segment),"%.2u", hour(Loc_t));
|
||||
//snprintf(segment, sizeof(segment),"%.2u", hour(Loc_t));
|
||||
snprintf(segment, sizeof(segment),"%.2u", hour(RTC_t));
|
||||
lcd.setCursor(0, 0);
|
||||
lcd.print(segment);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user