comparison Discovery/Src/tComm.c @ 458:5dd996ed8611 minor_improvments

Added ppO2 to dummy profile data: PPO2 calculation based on the first gas has been added to the dummy profile to enable drawing of the graph at log page four As this increased the number of parameters to be passed to the sub functions, the complete dive header is passed as reference instead of single members to increase the code maintanability
author ideenmodellierer
date Sat, 28 Mar 2020 21:41:47 +0100
parents 5e38b09d2c45
children dddfe7917131
comparison
equal deleted inserted replaced
457:4bd01f48c285 458:5dd996ed8611
581 RTC_DateTypeDef sdatestructure; 581 RTC_DateTypeDef sdatestructure;
582 RTC_TimeTypeDef stimestructure; 582 RTC_TimeTypeDef stimestructure;
583 #else 583 #else
584 uint8_t dummyForBootloader[256] = {0}; 584 uint8_t dummyForBootloader[256] = {0};
585 #endif 585 #endif
586
587 uint8_t count; 586 uint8_t count;
588 uint8_t aTxBuffer[128]; 587 uint8_t aTxBuffer[128];
589 uint8_t aRxBuffer[68]; 588 uint8_t aRxBuffer[68];
590 uint8_t answer; 589 uint8_t answer;
591 aTxBuffer[0] = type; 590 aTxBuffer[0] = type;
1181 logbook_getHeader(255 - aRxBuffer[0], &logbookHeader); 1180 logbook_getHeader(255 - aRxBuffer[0], &logbookHeader);
1182 plogbookHeaderOSTC3 = logbook_build_ostc3header(&logbookHeader); 1181 plogbookHeaderOSTC3 = logbook_build_ostc3header(&logbookHeader);
1183 if(HAL_UART_Transmit(&UartHandle, (uint8_t*)plogbookHeaderOSTC3, 256,5000)!= HAL_OK) 1182 if(HAL_UART_Transmit(&UartHandle, (uint8_t*)plogbookHeaderOSTC3, 256,5000)!= HAL_OK)
1184 return 0; 1183 return 0;
1185 1184
1186 if(logbookHeader.pBeginProfileData[0]==0) /* no sample information */ 1185 if((logbookHeader.pBeginProfileData[0]==0) /* no sample information */
1187 { 1186 && (logbookHeader.pBeginProfileData[1]==0)
1188 sampleTotalLength = logbook_fillDummySampleBuffer(logbookHeader.diveTimeMinutes, logbookHeader.diveTimeSeconds, logbookHeader.maxDepth, logbookHeader.lastDecostop_m, logbookHeader.minTemp); 1187 && (logbookHeader.pBeginProfileData[2]==0))
1188 {
1189 sampleTotalLength = logbook_fillDummySampleBuffer(&logbookHeader);
1189 while(sampleTotalLength >= 128) 1190 while(sampleTotalLength >= 128)
1190 { 1191 {
1191 logbook_readDummySamples(aTxBuffer,128); 1192 logbook_readDummySamples(aTxBuffer,128);
1192 sampleTotalLength -= 128; 1193 sampleTotalLength -= 128;
1193 if(HAL_UART_Transmit(&UartHandle, (uint8_t*)aTxBuffer, 128,5000)!= HAL_OK) 1194 if(HAL_UART_Transmit(&UartHandle, (uint8_t*)aTxBuffer, 128,5000)!= HAL_OK)