[PATCH 5/6] Fill out last_setpoint

Anton Lundin glance at acc.umu.se
Sat Nov 8 06:40:44 PST 2014


On 08 November, 2014 - Robert C. Helling wrote:

> Hi,
> 
> 
> 
> > Am 08.11.2014 um 14:11 schrieb Anton Lundin <glance at acc.umu.se>:
> > 
> > There was traces of filling last_setpoint out for any samples that
> > didn't have it. This adds the last bits for it.
> 
> This effectively reverts a patch that I recently sent. That fixed the problem that upon bailout the setpoint indeed changes to zero and that shouldn't be overwritten. 
> 

Ok, but then the last bits if the last_setpoint things should be removed
to as attached patch does.

//Anton

-- 
Anton Lundin	+46702-161604
-------------- next part --------------
>From f888c8e71bc81652aa91e010caf64c1350ff5417 Mon Sep 17 00:00:00 2001
From: Anton Lundin <glance at acc.umu.se>
Date: Sat, 8 Nov 2014 15:38:48 +0100
Subject: [PATCH] Remove leftover last_setpoint

Back in 24c491053cd9 ("Don't overwrite zero setpoints") the filling of
last_setpoint logic was removed. This clears out the last bits left
over.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 profile.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/profile.c b/profile.c
index 5bfe7b9..d3c5ef8 100644
--- a/profile.c
+++ b/profile.c
@@ -942,13 +942,12 @@ void fill_o2_values(struct divecomputer *dc, struct plot_info *pi, struct dive *
  * for plotting. This function called by: create_plot_info_new() */
 {
 	int i, j;
-	double last_setpoint, last_sensor[3], o2pressure, amb_pressure;
+	double last_sensor[3], o2pressure, amb_pressure;
 
 	for (i = 0; i < pi->nr; i++) {
 		struct plot_data *entry = pi->entry + i;
 		if (dc->dctype == CCR) {
-			if (i == 0) {	// For 1st iteration, initialise the last_ values
-				last_setpoint = pi->entry->o2setpoint;
+			if (i == 0) {	// For 1st iteration, initialise the last_sensor values
 				for (j = 0; j < dc->no_o2sensors; j++)
 					last_sensor[j] = pi->entry->o2sensor[j];
 			} else {	// Now re-insert the missing oxygen pressure values
-- 
1.9.1



More information about the subsurface mailing list