parent
a8c5fe343f
commit
9037ccef12
|
@ -417,6 +417,7 @@ float mapFast
|
|||
int16_t autoscale rawAuxTemp2;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3
|
||||
|
||||
int16_t autoscale rawAmbientTemp;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3
|
||||
uint32_t rtcUnixEpochTime
|
||||
|
||||
uint8_t[60 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
|
||||
uint8_t[56 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
|
||||
end_struct
|
||||
|
|
|
@ -202,6 +202,10 @@ void updateDevConsoleState() {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
#if EFI_RTC
|
||||
engine->outputChannels.rtcUnixEpochTime = getEpochTime();
|
||||
#endif
|
||||
|
||||
#if HAL_USE_ADC
|
||||
printFullAdcReportIfNeeded();
|
||||
#endif /* HAL_USE_ADC */
|
||||
|
|
|
@ -52,6 +52,19 @@ void setRtcDateTime(efidatetime_t const * const dateTime) {
|
|||
rtcSetTime(&RTCD1, ×pec);
|
||||
}
|
||||
|
||||
static time_t rtc_encode(const RTCDateTime *timespec) {
|
||||
struct tm tim;
|
||||
|
||||
rtcConvertDateTimeToStructTm(timespec, &tim, NULL);
|
||||
return mktime(&tim);
|
||||
}
|
||||
|
||||
uint32_t getEpochTime() {
|
||||
RTCDateTime timespec;
|
||||
rtcGetTime(&RTCD1, ×pec);
|
||||
return rtc_encode(×pec);
|
||||
}
|
||||
|
||||
efidatetime_t getRtcDateTime() {
|
||||
RTCDateTime timespec;
|
||||
rtcGetTime(&RTCD1, ×pec);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#if EFI_RTC
|
||||
void initRtc();
|
||||
void printRtcDateTime();
|
||||
uint32_t getEpochTime();
|
||||
efidatetime_t getRtcDateTime();
|
||||
void setRtcDateTime(const efidatetime_t * const dateTime);
|
||||
|
||||
|
|
|
@ -1527,6 +1527,7 @@ gaugeCategory = ECU Status
|
|||
firmwareVersionGauge = firmwareVersion , @@GAUGE_NAME_FW_VERSION@@, "%", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
timeSecondsGauge = seconds, @@GAUGE_NAME_UPTIME@@, "sec", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
tuneCrc16Gauge = tuneCrc16, @@GAUGE_NAME_TUNE_CRC16@@, "", 0, 64000, 0, 0, 64000, 64000, 0, 0
|
||||
rtcUnixEpochTimeGauge = rtcUnixEpochTime, "Epoch Time", "sec", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
|
||||
gaugeCategory = Debug
|
||||
debugF1Gauge = debugFloatField1, {bitStringValue( debugFieldF1List, debugMode )}, "", 0, 100, 0, 0, 100, 100, 4, 4
|
||||
|
|
Loading…
Reference in New Issue