comparison Discovery/Src/data_exchange_main.c @ 969:81049905d829 Evo_2_23

Zusammenf?hren
author heinrichsweikamp
date Sun, 19 Jan 2025 12:02:59 +0100
parents 3420e3ba698d
children d9290c76b840
comparison
equal deleted inserted replaced
968:b9a1710522b1 969:81049905d829
71 #include "tCCR.h" 71 #include "tCCR.h"
72 #include "timer.h" 72 #include "timer.h"
73 #include "buehlmann.h" 73 #include "buehlmann.h"
74 #include "externLogbookFlash.h" 74 #include "externLogbookFlash.h"
75 #include "vpm.h" 75 #include "vpm.h"
76 #include "check_warning.h"
76 77
77 /* #define TESTBENCH */ 78 /* #define TESTBENCH */
78 79
79 /* Exported variables --------------------------------------------------------*/ 80 /* Exported variables --------------------------------------------------------*/
80 static uint8_t wasPowerOn = 0; 81 static uint8_t wasPowerOn = 0;
439 externalInterface_Cmd |= EXT_INTERFACE_33V_ON; 440 externalInterface_Cmd |= EXT_INTERFACE_33V_ON;
440 externalInterface_Cmd &= (~EXT_INTERFACE_ADC_ON); 441 externalInterface_Cmd &= (~EXT_INTERFACE_ADC_ON);
441 } 442 }
442 #endif 443 #endif
443 444
445 #ifdef ENABLE_GPIO_V2
446 if(getBuzzerActivationState())
447 {
448 externalInterface_Cmd |= EXT_INTERFACE_BUZZER_ON;
449 }
450 #endif
451
444 dataOut.data.externalInterface_Cmd = externalInterface_Cmd; 452 dataOut.data.externalInterface_Cmd = externalInterface_Cmd;
445 externalInterface_Cmd = 0; 453 externalInterface_Cmd = 0;
446 454
447 if((hardwareDataGetPointer()->primarySerial <= 32) || (((hardwareDataGetPointer()->primarySerial == 72) && (hardwareDataGetPointer()->secondarySerial == 15)))) 455 if((hardwareDataGetPointer()->primarySerial <= 32) || (((hardwareDataGetPointer()->primarySerial == 72) && (hardwareDataGetPointer()->secondarySerial == 15))))
448 { 456 {
472 if(!wasUpdateNotPowerOn) 480 if(!wasUpdateNotPowerOn)
473 wasPowerOn = 1; 481 wasPowerOn = 1;
474 482
475 settingsHelperButtonSens_keepPercentageValues(settingsGetPointerStandard()->ButtonResponsiveness[3], settings->ButtonResponsiveness); 483 settingsHelperButtonSens_keepPercentageValues(settingsGetPointerStandard()->ButtonResponsiveness[3], settings->ButtonResponsiveness);
476 setButtonResponsiveness(settings->ButtonResponsiveness); 484 setButtonResponsiveness(settings->ButtonResponsiveness);
477 DataEX_setExtInterface_Cmd(EXT_INTERFACE_COPY_SENSORMAP); 485 DataEX_setExtInterface_Cmd(EXT_INTERFACE_COPY_SENSORMAP, 0);
478 } 486 }
479 } 487 }
480 488
481 489
482 void DataEX_copy_to_deco(void) 490 void DataEX_copy_to_deco(void)
581 static void DataEX_helper_set_Unknown_Date_deviceData(SDeviceLine *lineWrite) 589 static void DataEX_helper_set_Unknown_Date_deviceData(SDeviceLine *lineWrite)
582 { 590 {
583 RTC_DateTypeDef sdatestructure; 591 RTC_DateTypeDef sdatestructure;
584 RTC_TimeTypeDef stimestructure; 592 RTC_TimeTypeDef stimestructure;
585 593
594 const SFirmwareData *pFirmwareInfo;
595 pFirmwareInfo = firmwareDataGetPointer();
596
586 stimestructure.Hours = UNKNOWN_TIME_HOURS; 597 stimestructure.Hours = UNKNOWN_TIME_HOURS;
587 stimestructure.Minutes = UNKNOWN_TIME_MINUTES; 598 stimestructure.Minutes = UNKNOWN_TIME_MINUTES;
588 stimestructure.Seconds = UNKNOWN_TIME_SECOND; 599 stimestructure.Seconds = UNKNOWN_TIME_SECOND;
589 600
590 sdatestructure.Date = UNKNOWN_DATE_DAY; 601 sdatestructure.Date = UNKNOWN_DATE_DAY;
591 sdatestructure.Month = UNKNOWN_DATE_MONTH; 602 sdatestructure.Month = UNKNOWN_DATE_MONTH;
592 sdatestructure.Year = UNKNOWN_DATE_YEAR; 603 sdatestructure.Year = pFirmwareInfo->release_year;
593 setWeekday(&sdatestructure); 604 setWeekday(&sdatestructure);
594 605
595 DataEX_helper_SetTime(stimestructure, &lineWrite->time_rtc_tr); 606 DataEX_helper_SetTime(stimestructure, &lineWrite->time_rtc_tr);
596 DataEX_helper_SetDate(sdatestructure, &lineWrite->date_rtc_dr); 607 DataEX_helper_SetDate(sdatestructure, &lineWrite->date_rtc_dr);
597 } 608 }
1350 retval = hw_Info.extADC; 1361 retval = hw_Info.extADC;
1351 1362
1352 return retval; 1363 return retval;
1353 } 1364 }
1354 1365
1355 void DataEX_setExtInterface_Cmd(uint16_t Cmd) 1366 void DataEX_setExtInterface_Cmd(uint16_t Cmd, uint8_t sensorId)
1356 { 1367 {
1357 externalInterface_Cmd = Cmd; 1368 if(sensorId < EXT_INTERFACE_SENSOR_CNT - 1)
1369 {
1370 externalInterface_Cmd |= Cmd;
1371 externalInterface_Cmd |= sensorId << 8;
1372 }
1373
1358 return; 1374 return;
1359 } 1375 }
1360 1376