comparison Small_CPU/Src/spi.c @ 726:8f3a8c85a6c4

Bugfix data synchronization after RTE start: In previous version invalid data may be transferred in case the communication is corrupted directly after RTE startup. Root cause was that the data was evaluated without caring if a communication error was reported. In the new version the startup condition and evaluation of data is only done if valid data has been received by the RTE => SPI communication is up and runnig.
author Ideenmodellierer
date Sat, 14 Jan 2023 20:35:40 +0100
parents 1b995079c045
children
comparison
equal deleted inserted replaced
725:621265ec3d23 726:8f3a8c85a6c4
407 resettimeout = 0; 407 resettimeout = 0;
408 } 408 }
409 HAL_SPI_TransmitReceive_DMA(&hspi1,(uint8_t*) &(global.dataSendToMaster),(uint8_t*) &(global.dataSendToSlave), EXCHANGE_BUFFERSIZE); 409 HAL_SPI_TransmitReceive_DMA(&hspi1,(uint8_t*) &(global.dataSendToMaster),(uint8_t*) &(global.dataSendToSlave), EXCHANGE_BUFFERSIZE);
410 } 410 }
411 411
412 global.dataSendToMaster.power_on_reset = 0; 412 if(global.dataSendToSlaveIsValid)
413 global.deviceDataSendToMaster.power_on_reset = 0; 413 {
414 414 global.dataSendToMaster.power_on_reset = 0;
415 scheduleSpecial_Evaluate_DataSendToSlave(); 415 global.deviceDataSendToMaster.power_on_reset = 0;
416
417 scheduleSpecial_Evaluate_DataSendToSlave();
418 }
416 419
417 if(resettimeout) 420 if(resettimeout)
418 { 421 {
419 global.check_sync_not_running = 0; 422 global.check_sync_not_running = 0;
420 } 423 }