Mercurial > public > ostc4
comparison Discovery/Src/simulation.c @ 300:5ca177d2df5d cleanup-4
cleanup: remove commented/unused code, make static
without any functional change.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Fri, 17 May 2019 21:19:04 +0200 |
parents | 9f0efc4df01e |
children | 43b44f8d4fb0 |
comparison
equal
deleted
inserted
replaced
299:b70c26be71a0 | 300:5ca177d2df5d |
---|---|
49 | 49 |
50 static const float sim_descent_rate_meter_per_min = 20; | 50 static const float sim_descent_rate_meter_per_min = 20; |
51 | 51 |
52 | 52 |
53 //Private functions | 53 //Private functions |
54 static float sim_get_ambiant_pressure(SDiveState * pDiveState); | 54 static float sim_get_ambient_pressure(SDiveState * pDiveState); |
55 static void sim_reduce_deco_time_one_second(SDiveState* pDiveState); | 55 static void sim_reduce_deco_time_one_second(SDiveState* pDiveState); |
56 static void simulation_set_aim_depth(int depth_meter); | 56 static void simulation_set_aim_depth(int depth_meter); |
57 | 57 |
58 /** | 58 /** |
59 ****************************************************************************** | 59 ****************************************************************************** |
155 pDiveState->lifeData.sensorVoltage_mV[0] = stateRealGetPointer()->lifeData.sensorVoltage_mV[0]; | 155 pDiveState->lifeData.sensorVoltage_mV[0] = stateRealGetPointer()->lifeData.sensorVoltage_mV[0]; |
156 pDiveState->lifeData.sensorVoltage_mV[1] = stateRealGetPointer()->lifeData.sensorVoltage_mV[1]; | 156 pDiveState->lifeData.sensorVoltage_mV[1] = stateRealGetPointer()->lifeData.sensorVoltage_mV[1]; |
157 pDiveState->lifeData.sensorVoltage_mV[2] = stateRealGetPointer()->lifeData.sensorVoltage_mV[2]; | 157 pDiveState->lifeData.sensorVoltage_mV[2] = stateRealGetPointer()->lifeData.sensorVoltage_mV[2]; |
158 | 158 |
159 pDiveState->lifeData.dive_time_seconds += 1; | 159 pDiveState->lifeData.dive_time_seconds += 1; |
160 pDiveState->lifeData.pressure_ambient_bar = sim_get_ambiant_pressure(pDiveState); | 160 pDiveState->lifeData.pressure_ambient_bar = sim_get_ambient_pressure(pDiveState); |
161 | 161 |
162 if(!is_ambient_pressure_close_to_surface(&pDiveState->lifeData) && !(stateSimGetPointer()->lifeData.counterSecondsShallowDepth) ) | 162 if(!is_ambient_pressure_close_to_surface(&pDiveState->lifeData) && !(stateSimGetPointer()->lifeData.counterSecondsShallowDepth) ) |
163 { | 163 { |
164 pDiveState->lifeData.dive_time_seconds_without_surface_time += 1; | 164 pDiveState->lifeData.dive_time_seconds_without_surface_time += 1; |
165 } | 165 } |
301 sim_aim_depth_meter = depth_meter; | 301 sim_aim_depth_meter = depth_meter; |
302 } | 302 } |
303 | 303 |
304 /** | 304 /** |
305 ****************************************************************************** | 305 ****************************************************************************** |
306 * @brief simulates ambiant pressure depending on aim depth | 306 * @brief simulates ambient pressure depending on aim depth |
307 ****************************************************************************** | 307 ****************************************************************************** |
308 * @note if aim_depth != actual depth, the depth change within one second | 308 * @note if aim_depth != actual depth, the depth change within one second |
309 * (depending on descent or ascent) rate is calculated | 309 * (depending on descent or ascent) rate is calculated |
310 * @param SDiveState* pDiveState: | 310 * @param SDiveState* pDiveState: |
311 * @return float : new ambiant pressure | 311 * @return float : new ambient pressure |
312 */ | 312 */ |
313 static float sim_get_ambiant_pressure(SDiveState * pDiveState) | 313 static float sim_get_ambient_pressure(SDiveState * pDiveState) |
314 { | 314 { |
315 //Calc next depth | 315 //Calc next depth |
316 uint8_t actual_deco_stop = decom_get_actual_deco_stop(pDiveState); | 316 uint8_t actual_deco_stop = decom_get_actual_deco_stop(pDiveState); |
317 float depth_meter = pDiveState->lifeData.depth_meter; | 317 float depth_meter = pDiveState->lifeData.depth_meter; |
318 float surface_pressure_bar = pDiveState->lifeData.pressure_surface_bar; | 318 float surface_pressure_bar = pDiveState->lifeData.pressure_surface_bar; |
349 ****************************************************************************** | 349 ****************************************************************************** |
350 * @note called during fast simulation | 350 * @note called during fast simulation |
351 * @param SDiveState* pDiveState: | 351 * @param SDiveState* pDiveState: |
352 * @return void | 352 * @return void |
353 */ | 353 */ |
354 void sim_reduce_deco_time_one_second(SDiveState* pDiveState) | 354 static void sim_reduce_deco_time_one_second(SDiveState* pDiveState) |
355 { | 355 { |
356 SDecoinfo* pDecoinfo; | 356 SDecoinfo* pDecoinfo; |
357 if(pDiveState->diveSettings.deco_type.ub.standard == GF_MODE) | 357 if(pDiveState->diveSettings.deco_type.ub.standard == GF_MODE) |
358 pDecoinfo = &pDiveState->decolistBuehlmann; | 358 pDecoinfo = &pDiveState->decolistBuehlmann; |
359 else | 359 else |