Mercurial > public > ostc4
changeset 57:e941c9e49f73
Resolve format warnings
author | Ideenmodellierer |
---|---|
date | Thu, 09 Aug 2018 22:38:56 +0200 |
parents | bab006305b58 |
children | e97deb6e2705 |
files | Common/Src/decom.c Discovery/Src/tMenuEditSystem.c |
diffstat | 2 files changed, 121 insertions(+), 121 deletions(-) [+] |
line wrap: on
line diff
--- a/Common/Src/decom.c Tue Aug 07 17:03:36 2018 +0200 +++ b/Common/Src/decom.c Thu Aug 09 22:38:56 2018 +0200 @@ -256,134 +256,134 @@ int period_in_seconds_left; - if(period_in_seconds <= 0) - return; - + if(period_in_seconds > 0) + { decom_get_inert_gases(ambiant_pressure_bar, pActualGas, &percent_N2, &percent_He); partial_pressure_N2 = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_N2; partial_pressure_He = (ambiant_pressure_bar - WATER_VAPOUR_PRESSURE) * percent_He; - period_in_seconds_left = period_in_seconds; + period_in_seconds_left = period_in_seconds; - while(period_in_seconds_left) - { - if(period_in_seconds_left >= 3600) - period_in_seconds = 3600; - else - if(period_in_seconds_left >= 800) - period_in_seconds = 800; - else - if(period_in_seconds_left >= 300) - period_in_seconds = 300; - else - if(period_in_seconds_left >= 100) - period_in_seconds = 100; - else - if(period_in_seconds_left >= 60) - period_in_seconds = 60; - else - if(period_in_seconds_left == 36) - period_in_seconds = 18; - else - if(period_in_seconds_left >= 20) - period_in_seconds = 20; - else - if(period_in_seconds_left >= 18) - period_in_seconds = 18; - else - if(period_in_seconds_left >= 10) - period_in_seconds = 10; - else - if(period_in_seconds_left >= 8) - period_in_seconds = 8; - else - if(period_in_seconds_left >= 3) - period_in_seconds = 3; - else - period_in_seconds = 1; + while(period_in_seconds_left) + { + if(period_in_seconds_left >= 3600) + period_in_seconds = 3600; + else + if(period_in_seconds_left >= 800) + period_in_seconds = 800; + else + if(period_in_seconds_left >= 300) + period_in_seconds = 300; + else + if(period_in_seconds_left >= 100) + period_in_seconds = 100; + else + if(period_in_seconds_left >= 60) + period_in_seconds = 60; + else + if(period_in_seconds_left == 36) + period_in_seconds = 18; + else + if(period_in_seconds_left >= 20) + period_in_seconds = 20; + else + if(period_in_seconds_left >= 18) + period_in_seconds = 18; + else + if(period_in_seconds_left >= 10) + period_in_seconds = 10; + else + if(period_in_seconds_left >= 8) + period_in_seconds = 8; + else + if(period_in_seconds_left >= 3) + period_in_seconds = 3; + else + period_in_seconds = 1; - period_in_seconds_left -= period_in_seconds; + period_in_seconds_left -= period_in_seconds; - switch (period_in_seconds) - { - case 1: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_second[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_second[ci]; - } - break; - case 3: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_003_second[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_003_second[ci]; - } - break; - case 8: - for (ci=0;ci<16;ci++) + switch (period_in_seconds) { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_008_second[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_008_second[ci]; - } - break; - case 10: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_10_seconds[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_10_seconds[ci]; - } - break; - case 18: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_18_seconds[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_18_seconds[ci]; - } - break; - case 20: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_20_seconds[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_20_seconds[ci]; + case 1: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_second[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_second[ci]; + } + break; + case 3: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_003_second[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_003_second[ci]; + } + break; + case 8: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_008_second[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_008_second[ci]; + } + break; + case 10: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_10_seconds[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_10_seconds[ci]; + } + break; + case 18: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_18_seconds[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_18_seconds[ci]; + } + break; + case 20: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_20_seconds[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_20_seconds[ci]; + } + break; + case 60: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_minute[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_minute[ci]; + } + break; + case 100: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_100_second[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_100_second[ci]; + } + break; + case 300: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_five_minutes[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_five_minutes[ci]; + } + break; + case 800: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_800_second[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_800_second[ci]; + } + break; + case 3600: + for (ci=0;ci<16;ci++) + { + tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_hour[ci]; + tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_hour[ci]; + } + break; } - break; - case 60: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_minute[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_minute[ci]; - } - break; - case 100: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_100_second[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_100_second[ci]; - } - break; - case 300: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_five_minutes[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_five_minutes[ci]; - } - break; - case 800: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_800_second[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_800_second[ci]; - } - break; - case 3600: - for (ci=0;ci<16;ci++) - { - tissue_N2_selected_stage[ci] += (partial_pressure_N2 - tissue_N2_selected_stage[ci]) * float_buehlmann_N2_factor_expositon_one_hour[ci]; - tissue_He_selected_stage[ci] += (partial_pressure_He - tissue_He_selected_stage[ci]) * float_buehlmann_He_factor_expositon_one_hour[ci]; - } - break; } } }
--- a/Discovery/Src/tMenuEditSystem.c Tue Aug 07 17:03:36 2018 +0200 +++ b/Discovery/Src/tMenuEditSystem.c Thu Aug 09 22:38:56 2018 +0200 @@ -1157,7 +1157,7 @@ text_content[1] = TXT2BYTE_ChargeCycles; text_content[2] = 0; write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); - snprintf(text_content,80,"%i (%i)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); + snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->batteryChargeCycles.value_int32,stateDeviceGetPointer()->batteryChargeCompleteCycles.value_int32); write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); translateDate(stateDeviceGetPointer()->batteryChargeCycles.date_rtc_dr, &Sdate); @@ -1190,7 +1190,7 @@ text_content[2] = 0; write_label_var( 20, 800, ME_Y_LINE1, &FontT42, text_content); - snprintf(text_content,80,"%i (%i)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); + snprintf(text_content,80,"%ld (%ld)",stateDeviceGetPointer()->diveCycles.value_int32,(stateDeviceGetPointer()->depthMaximum.value_int32 - 1000) / 100); write_label_var( 20, 800, ME_Y_LINE2, &FontT42, text_content); translateDate(stateDeviceGetPointer()->diveCycles.date_rtc_dr, &Sdate); @@ -1203,7 +1203,7 @@ text_content[2] = 0; write_label_var( 20, 800, ME_Y_LINE4, &FontT42, text_content); - snprintf(text_content,80,"%i",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); + snprintf(text_content,80,"%ld",(stateDeviceGetPointer()->hoursOfOperation.value_int32)/3600); write_label_var( 20, 800, ME_Y_LINE5, &FontT42, text_content); text_button[0] = TXT_2BYTE;