comparison Discovery/Src/logbook.c @ 200:7116c0ffb862

Merged in janlmulder/ostc4/div-fixes-cleaup-2 (pull request #8) 2 (simple) bugfixes and again some cleanup
author heinrichsweikamp <bitbucket@heinrichsweikamp.com>
date Fri, 22 Mar 2019 08:15:30 +0000
parents ac58a9fb92ac
children 2bb1db22b5f5
comparison
equal deleted inserted replaced
195:05df3b395615 200:7116c0ffb862
236 header.dateYear = Sdate.Year; 236 header.dateYear = Sdate.Year;
237 header.dateMonth = Sdate.Month; 237 header.dateMonth = Sdate.Month;
238 header.dateDay = Sdate.Date; 238 header.dateDay = Sdate.Date;
239 header.timeHour = Stime.Hours; 239 header.timeHour = Stime.Hours;
240 header.timeMinute = Stime.Minutes; 240 header.timeMinute = Stime.Minutes;
241 header.cnsAtBeginning = (uint16_t)((pInfo->lifeData.cns * 100) + 0.5f); 241 header.cnsAtBeginning = (uint16_t)pInfo->lifeData.cns;
242 header.surfacePressure_mbar = (uint16_t)(pInfo->lifeData.pressure_surface_bar * 1000); 242 header.surfacePressure_mbar = (uint16_t)(pInfo->lifeData.pressure_surface_bar * 1000);
243 header.firmwareVersionHigh = firmwareVersion_16bit_high(); 243 header.firmwareVersionHigh = firmwareVersion_16bit_high();
244 header.firmwareVersionLow = firmwareVersion_16bit_low(); 244 header.firmwareVersionLow = firmwareVersion_16bit_low();
245 header.logbookProfileVersion = LOGBOOK_VERSION; 245 header.logbookProfileVersion = LOGBOOK_VERSION;
246 header.salinity = pSettings->salinity; 246 header.salinity = pSettings->salinity;
607 } 607 }
608 } 608 }
609 if(divisor.cns == 0) 609 if(divisor.cns == 0)
610 { 610 {
611 divisor.cns = smallHeader.cnsDivisor - 1; 611 divisor.cns = smallHeader.cnsDivisor - 1;
612 //addU16(&sample[length], (uint16_t)(state.lifeData.cns * 100.0f + 0.5f)); 612 addU16(&sample[length], (uint16_t)state.lifeData.cns);
613 addU16(&sample[length], (uint16_t)(state.lifeData.cns)); // hw 151110 cns is 0 to 100 % and more (not 0 to 1.00 and more)
614 length += 2; 613 length += 2;
615 } 614 }
616 else 615 else
617 { 616 {
618 divisor.cns--; 617 divisor.cns--;