[Ovmsdev] Working on ESP-IDF5 + Have a question about ovms_module 'Name'
Michael Balzer
dexter at expeedo.de
Wed Jan 24 15:08:43 HKT 2024
Michael,
Am 21.01.24 um 02:54 schrieb Michael Geddes:
> Hey, In working trying to get ESP-IDF 5+ Working, I came across the
> following fun thing that I'm trying to work out what is going on!!
> This is from main/ovms_module.cpp
> I'm not sure why we don't just go through all the words and compare -
> why the masked compare for the last entry! And why that value?? It
> might make sense if you masked out the final byte ... I'm just
> struggling to understand.
From the further accesses to the last word/byte in TaskMap, I'd guess
Steve intended using the sign bit on the last byte as some special
indicator, but it's not clear to me for what purpose. It also doesn't
seem to be relevant anymore.
Steve's commit message is verbose
(30d0a403a380e797f9b222b01dab8da791ab388c), and maybe you can find some
more explanation in the list archives.
Regards,
Michael
> Why am I looking at it?? Well there's a new warning about copy
> constructors.. and then I ran into a problem where 'Name' is sometimes
> in memory that can only be accessed 32bit int aligned (which is why
> the strange implementation in the first place - I get that).
>
> Can anybody shed any light on this?
>
>
> class Name
> {.......
> inline bool operator==(const Name& a) const
> {
> for (int i = 0; i < NAMELEN/4 - 1; ++i)
> if (a.words[i] != words[i]) return false;
> i*f (a.words[NAMELEN/4-1] != (words[NAMELEN/4-1] & 0x7FFFFFFF))
> return false;*
> return true;
> }
>
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev
--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20240124/a7f01cff/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20240124/a7f01cff/attachment.sig>
More information about the OvmsDev
mailing list