You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • what happens on something like clearwatch ?

    As far as I know, clearWatch wouldn't stop those watches (there's a list of JS watches stored in a JsVar).

    Would it be a better option to change definition of jshEventCallbacks in jsdevices to a struct

    Maybe. I've been trying to avoid things like that though - there are 16 watch targets so with a 32 bit pointer that's 64 bytes of RAM that's then not available to the user. Not a big deal on bigger parts, but when 99.9% of users wouldn't use it, it seems like a bit of a waste (esp on the smaller parts).

    I don't think it'd slow anything down noticably - so really it's just whether it's a good idea memory-wise.

    Another quick solution would be to just pass the EXTI number into the function as an argument, and then you could work out where everything went yourself (since jshPinWatch will return the EXTI when called).

About

Avatar for Gordon @Gordon started