From 3fff2caac8f52bbc5dbc05aa907de0fd98ed175e Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 10 Oct 2014 16:39:21 +1100 Subject: [PATCH] Sanity check in the PW calc incase TPS value is stupid --- utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.h b/utils.h index 68e36ba2..5c93be68 100644 --- a/utils.h +++ b/utils.h @@ -64,5 +64,7 @@ unsigned int PW_SD(int REQ_FUEL, byte VE, byte MAP, int corrections, int injOpen unsigned int PW_AN(int REQ_FUEL, byte VE, byte TPS, int corrections, int injOpen) { + //Sanity check + if(TPS > 100) { TPS = 100; } return PW(REQ_FUEL, VE, 100, corrections, injOpen, TPS); //Just use 1 in place of the MAP }