Mercurial > public > ostc4
comparison Discovery/Src/data_exchange_main.c @ 763:aa6006975e76
increase HAL_Delay to 10ms for cold-start-button reset
+ typos and comment changes
author | heinrichsweikamp |
---|---|
date | Sun, 26 Mar 2023 18:34:30 +0200 |
parents | df0d43da1614 |
children | 45b8f3c2acce |
comparison
equal
deleted
inserted
replaced
762:32529dfea3b0 | 763:aa6006975e76 |
---|---|
281 { | 281 { |
282 SusppressCom--; | 282 SusppressCom--; |
283 } | 283 } |
284 else | 284 else |
285 { | 285 { |
286 if(data_old__lost_connection_to_slave_counter_temp >= 2) /* error reaction is triggered whenever communication could not be reestablishen within two cycles */ | 286 if(data_old__lost_connection_to_slave_counter_temp >= 2) /* error reaction is triggered whenever communication could not be reestablished within two cycles */ |
287 { | 287 { |
288 data_old__lost_connection_to_slave_counter_temp = 0; | 288 data_old__lost_connection_to_slave_counter_temp = 0; |
289 if(DataEX_check_header_and_footer_shifted()) | 289 if(DataEX_check_header_and_footer_shifted()) |
290 { | 290 { |
291 if(RTEOfflineCnt > 1) /* RTE restarted communication after a longer silent time => restart error handling to recover */ | 291 if(RTEOfflineCnt > 1) /* RTE restarted communication after a longer silent time => restart error handling to recover */ |
297 /* We received shifted data. Step one. Reset DMA to see if the problem is located at main */ | 297 /* We received shifted data. Step one. Reset DMA to see if the problem is located at main */ |
298 if (data_old__lost_connection_to_slave_counter_retry == 0) | 298 if (data_old__lost_connection_to_slave_counter_retry == 0) |
299 { | 299 { |
300 HAL_SPI_Abort_IT(&cpu2DmaSpi); | 300 HAL_SPI_Abort_IT(&cpu2DmaSpi); |
301 } | 301 } |
302 /* reset of own DMA does not work ==> request reset of slave dma by indicating shifted receiption */ | 302 /* reset of own DMA does not work ==> request reset of slave dma by indicating shifted reception */ |
303 if (data_old__lost_connection_to_slave_counter_retry == 1) | 303 if (data_old__lost_connection_to_slave_counter_retry == 1) |
304 { | 304 { |
305 dataOut.header.checkCode[SPI_HEADER_INDEX_RX_STATE] = SPI_RX_STATE_SHIFTED; | 305 dataOut.header.checkCode[SPI_HEADER_INDEX_RX_STATE] = SPI_RX_STATE_SHIFTED; |
306 } | 306 } |
307 | 307 |