<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Michael,<br>
<br>
<div class="moz-cite-prefix">Am 06.02.2013 13:10, schrieb
<a class="moz-txt-link-abbreviated" href="mailto:mikeljo@mac.com">mikeljo@mac.com</a>:<br>
</div>
<blockquote cite="mid:BA5934F1-1DF7-4664-8193-6B79E7311331@mac.com"
type="cite">
<div><span style="background-color: rgb(255, 255, 255);
font-family: arial, sans-serif; font-size: 13px; white-space:
nowrap; ">
<div>
<div><span style="background-color: rgb(255, 255, 255);
font-family: arial, sans-serif; font-size: 13px;
white-space: nowrap; ">witch bits is now what?</span></div>
</div>
</span></div>
</blockquote>
<blockquote cite="mid:BA5934F1-1DF7-4664-8193-6B79E7311331@mac.com"
type="cite">
<div><span style="background-color: rgb(255, 255, 255);
font-family: arial, sans-serif; font-size: 13px; white-space:
nowrap; ">
<div>
<div>My understanding is that the MSB is "FrontLeftDoor" and
the LSB is "CarON".</div>
<br>
</div>
</span></div>
</blockquote>
<br>
My fault, I should have added a remark.<br>
<br>
The original bit values are documented in the "OVMS Protocol"
document (environment message).<br>
<br>
"OVMS Development" adds: PIC18F is little endian, i.e. [...] Bit
fields are packed right to left<br>
<br>
So, it's LSB first, 0x01 .. 0x80.<br>
<br>
<br>
<blockquote cite="mid:BA5934F1-1DF7-4664-8193-6B79E7311331@mac.com"
type="cite">
<div><span style="background-color: rgb(255, 255, 255);
font-family: arial, sans-serif; font-size: 13px; white-space:
nowrap; ">
<div>I think it is better to use the bits direct. Like this:
car_doors1bits.ChargePort = 1</div>
</span></div>
</blockquote>
<br>
"Better" will be dependant on your concrete needs. I like to be able
to access single bits like this due to better readability.<br>
<br>
But if you need to set or query a larger group of bits, the combined
byte value will be more readable and perform better.<br>
<br>
Regards,<br>
Michael<br>
<br>
<pre class="moz-signature" cols="72">--
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
</pre>
</body>
</html>