• Can I use setWatch (function, pin, {ir:true}) on stm32f4discovery, where function on C code with recompile firmware ?

  • You want to use setWatch with irq:true, with a function you defined in your own firmware? If so, yes you can - there's nothing special to do. Just write the function and it'll work.

    However you wouldn't be able to use http://www.espruino.com/InlineC on the STM32F4discovery, since it's a service I only provide to paid boards.

  • I write from memory - a possible error in the syntax:
    //wiegand.c
    /*JSON{
    "type" : "staticmethod",
    "class" : "wiegand",
    "name" : "ReadD0",
    "generate" : "jswrap_ReadD0"
    } */

    void jswrap_ReadD0{
    / /do
    }

    setWatch(function(e) { wiegand.ReadD0; }, E2, { repeat:true, edge:'falling', irq : true});
    setWatch(wiegand.ReadD0, E2, { repeat:true, edge:'falling', irq : true});

    Espruino write:".. not native function .."
    please tell me the reason?

  • // This one will fail - you're defining a JS function *around* the native one
    setWatch(function(e) { wiegand.ReadD0; }, E2, { repeat:true, edge:'falling', irq : true});
    // This one should work just fine
    setWatch(wiegand.ReadD0, E2, { repeat:true, edge:'falling', irq : true});
    
  • Thank you very much for your attention!

  • Hi,
    is it right that when irq:true, edge: 'rising' / 'falling' - does not work ?

  • Yes, and no debounce either - check out the setWatch reference: http://www.espruino.com/Reference#l__glo­bal_setWatch

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Interrupts on stm32f4 discovery with recompile firmware with C code

Posted by Avatar for MaksR @MaksR

Actions