Thanks that helps. On the queue problem here's what I've been looking at based on the E.on('IRQ15', function() { ... }) that you've been suggesting.
//an object
function IRQ(a){
this.A=a;
}//end LogObj
//create an instance
var a=new IRQ(3);
//display the object
console.log(a);
//create a listener for the object
a.on("IRQ1",function(d){
//ISR code goes here
//then display the timer results
console.log("IRQ1");
console.log(d);
});
//Simulate the interrupt
a.emit("IRQ1","hello");
IRQ.prototype.setup = function() {
// setup asm code in memory
// put address in interrupt table
};
>echo(0);
{ "A": 3 }
=undefined
IRQ1
hello
So either place the call to a.emit in the assembly code or call the assembly code from the a.on() function and place the corresponding address in the interrupt table.
How does one obtain the address of a function such as a.emit to call?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Thanks that helps. On the queue problem here's what I've been looking at based on the E.on('IRQ15', function() { ... }) that you've been suggesting.
So either place the call to a.emit in the assembly code or call the assembly code from the a.on() function and place the corresponding address in the interrupt table.
How does one obtain the address of a function such as a.emit to call?