comparison Discovery/Src/data_exchange_main.c @ 90:83857eb3b12b kittz

+- stable
author Dmitry Romanov <kitt@bk.ru>
date Fri, 23 Nov 2018 18:14:56 +0300
parents ff7775cc34c4
children 6a2308b9a3d4
comparison
equal deleted inserted replaced
89:ff7775cc34c4 90:83857eb3b12b
304 uint8_t DataEX_call(void) 304 uint8_t DataEX_call(void)
305 { 305 {
306 uint8_t SPI_DMA_answer = 0; 306 uint8_t SPI_DMA_answer = 0;
307 307
308 HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET); 308 HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_SET);
309 delayMicros(30); //~exchange time(+20% reserve) 309 delayMicros(50); //~exchange time(+20% reserve)
310 HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_RESET); 310 HAL_GPIO_WritePin(SMALLCPU_CSB_GPIO_PORT,SMALLCPU_CSB_PIN,GPIO_PIN_RESET);
311 /* one cycle with NotChipSelect true to clear slave spi buffer */ 311 /* one cycle with NotChipSelect true to clear slave spi buffer */
312 312
313 if(data_old__lost_connection_to_slave_counter_temp >= 3) 313 if(data_old__lost_connection_to_slave_counter_temp >= 3)
314 { 314 {
455 SDiveState * pStateUsed; 455 SDiveState * pStateUsed;
456 if(decoLock == DECO_CALC_running) 456 if(decoLock == DECO_CALC_running)
457 return; 457 return;
458 if(stateUsed == stateRealGetPointer()) 458 if(stateUsed == stateRealGetPointer())
459 pStateUsed = stateRealGetPointerWrite(); 459 pStateUsed = stateRealGetPointerWrite();
460 else 460 else{
461 pStateUsed = stateSimGetPointerWrite(); 461 pStateUsed = stateSimGetPointerWrite();
462 462 }
463 463
464 if(decoLock == DECO_CALC_init_as_is_start_of_dive) 464 if(decoLock == DECO_CALC_init_as_is_start_of_dive)
465 { 465 {
466 vpm_init(&pStateUsed->vpm, pStateUsed->diveSettings.vpm_conservatism, 0, 0); 466 vpm_init(&pStateUsed->vpm, pStateUsed->diveSettings.vpm_conservatism, 0, 0);
467 buehlmann_init(); 467 buehlmann_init();