Code Monkey home page Code Monkey logo

Comments (3)

gitcnd avatar gitcnd commented on July 21, 2024

By process of elimination, I discovered that this is the culprit:-

	if (mask && ((uint32_t)1 << 14)) {
		buffer_append_int32(send_buffer, mc_interface_get_tachometer_abs_value(false), &ind);
	}

Whether or not we set bit 14, we ALWAYS get this returned to us.

I don't know why - but it is a fact.

Here are 2 reply packets, as I got them over the wire (preceded with my binary bitmask for clarity):-

// 00000000 00000010 11100000 00000000 = 2 15 50 0 2 224 0 0 0 0 24 0 0 0 92 0 110 15 209 3
// 00000000 00000010 10100000 00000000 = 2 15 50 0 2 160 0 0 0 0 36 0 0 0 104 0 110 192 18 3

As you can see, the requests are different (bit 14 is NOT set in the second one), the reply mask is different (bit 14 NOT set), but the packets are both 15 bytes long (impossible, because I asked for 14 in one, but not in the second)...

The deeper and much more worrying problem here - this is not a code mistake, the code is perfect - it's some kind of compiler behaviour weirdness, or runtime corruption, or something... and if it's happening here, where else is it hiding?

from bldc.

ledvinap avatar ledvinap commented on July 21, 2024

&& operator is obviously typo - bitwise and & must be used

from bldc.

vedderb avatar vedderb commented on July 21, 2024

The && is the problem of course. This is fixed in FW3.57.

from bldc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.