From 2769d52fc9d4df1e1fb1157a709945973d2bc841 Mon Sep 17 00:00:00 2001 From: localhorst Date: Wed, 21 Nov 2018 23:45:26 +0100 Subject: [PATCH] first steps for time --- Software/src/main.cpp | 23 +++++++++++++++++++++++ Software/src/openChargeMicro.h | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Software/src/main.cpp b/Software/src/main.cpp index ccbb3c1..d420924 100644 --- a/Software/src/main.cpp +++ b/Software/src/main.cpp @@ -14,6 +14,29 @@ int main(void) { io.setActiveLED(true); io.activateChargers(); + time_t testStamp; + + time(&testStamp); + + char charTime[255]; + + dtostrf(testStamp, 4, 2, charTime); + serialSend("Time: "); + serialSend (charTime); + serialSend(" \r\n"); + + _delay_ms(1000); + + + time(&testStamp); + + dtostrf(testStamp, 4, 2, charTime); + serialSend("Time: "); + serialSend (charTime); + serialSend(" \r\n"); + + _delay_ms(1000); + /* create charger */ s_charger charger_settings; diff --git a/Software/src/openChargeMicro.h b/Software/src/openChargeMicro.h index b558761..a1251b6 100644 --- a/Software/src/openChargeMicro.h +++ b/Software/src/openChargeMicro.h @@ -1,15 +1,18 @@ +/* system header */ #include #include #include #include #include #include +#include +/* project header */ #include "ioController.h" #include "multiplexer.h" #include "charger.h" -/* PINS */ +/* Pins */ #define WS2812B PD2 #define ACTIVELED PB5 #define PROBE15V PC1 @@ -23,6 +26,7 @@ #define S1 PD6 #define S0 PD5 +/* Serial */ #define BUAD 9600 #define BUAD_RATE_CALC ((F_CPU/16/BUAD) - 1)