comparison Discovery/Src/data_exchange_main.c @ 430:30580cf5ee77

Merged in Ideenmodellierer/ostc4/ImprovmentNVM_2 (pull request #39) ImprovmentNVM 2
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Tue, 18 Feb 2020 07:20:29 +0000
parents 3f7d80f37bfc
children 079f32a8e68c
comparison
equal deleted inserted replaced
419:c2264ce139cb 430:30580cf5ee77
638 638
639 dataLengthRead = ext_flash_read_devicedata((uint8_t *)&DeviceDataFlash,sizeof(SDevice)); 639 dataLengthRead = ext_flash_read_devicedata((uint8_t *)&DeviceDataFlash,sizeof(SDevice));
640 640
641 if(dataLengthRead == 0) 641 if(dataLengthRead == 0)
642 { 642 {
643 ext_flash_write_devicedata(); 643 ext_flash_write_devicedata(false);
644 return; 644 return;
645 } 645 }
646 646
647 /* max values */ 647 /* max values */
648 if(DeviceData->batteryChargeCompleteCycles.value_int32 < DeviceDataFlash.batteryChargeCompleteCycles.value_int32) 648 if(DeviceData->batteryChargeCompleteCycles.value_int32 < DeviceDataFlash.batteryChargeCompleteCycles.value_int32)
680 { 680 {
681 DataEX_helper_copy_deviceData(&DeviceData->voltageMinimum, &DeviceDataFlash.voltageMinimum); 681 DataEX_helper_copy_deviceData(&DeviceData->voltageMinimum, &DeviceDataFlash.voltageMinimum);
682 } 682 }
683 683
684 DataEX_check_DeviceData (); 684 DataEX_check_DeviceData ();
685 ext_flash_write_devicedata(); 685 ext_flash_write_devicedata(false);
686 } 686 }
687 687
688 688
689 static void DataEX_copy_to_DeviceData(void) 689 static void DataEX_copy_to_DeviceData(void)
690 { 690 {