-
• #2
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.
-
• #3
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? -
• #4
// 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});
-
• #5
Thank you very much for your attention!
-
• #6
Hi,
is it right that when irq:true, edge: 'rising' / 'falling' - does not work ? -
• #7
Yes, and no debounce either - check out the setWatch reference: http://www.espruino.com/Reference#l__global_setWatch
Can I use setWatch (function, pin, {ir:true}) on stm32f4discovery, where function on C code with recompile firmware ?