[Ovmsdev] Motor temp does not support negative numbers (car_tmotor)

Collin Kidder collink at kkmfg.com
Mon Jan 13 21:51:44 HKT 2014


I don't think you'd want to do that. 127 deg C really isn't that terribly
hot and -128C is extremely cold. If it is necessary to retain use of an 8
bit variable then the standard solution is to just offset the temperature
stored by -40. That way you can read -40 to 215C which is a pretty
reasonable range. Unfortunately, I fear such a change would necessitate
many other changes in code. It might be better to expand to a signed 16 bit
integer.


On Mon, Jan 13, 2014 at 7:50 AM, Håkon Markussen
<hakon.markussen at gmail.com>wrote:

> Hi (Mark).
>
> In ovms.h the motor temperature is defined as unsigned char (non-negative):
> extern unsigned char car_tmotor; // Tmotor
>
> Currently the weather is cold in Norway (-15 C) and I noticed that motor
> temp was 244C.
>
>
> Is it possible to update the car_tmotor to
> extern signed char car_tmotor; // Tmotor
>  in ovms.h?
>
> Best regards
> Håkon
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20140113/81c3b487/attachment.htm>


More information about the OvmsDev mailing list