Right, I've had a complete rewrite of the code today, it is much more cleaner now and the non interrupt section takes about 60us now, which includes reading multiple inputs (one of these using the 4051 mux chip), along with writing to a few external shift registers. This has 'laxed the requirements a bit as I can consume a bit more processor time in the interrupt than originally. I've taken your advice for using correct data types and I completely agree, reading the code is much easier to understand which variables are boolean etc.
One thing to ask about functions within the maple IDE is the use of tabs. I've been doing my functions in a seperate tab so I can keep a hold on every part of the code with ease. One thing i've found though is declaring a variable in one of these tabs is not the same as declaring in the main tab (the one named after the program), this is no problem as I just write the variables used in the tab, inside of the tab and global variables in the main tab. Does this mean that the compiler will react different to variables declared globally and variables declared in these tabs?
I really think that i'm going to have to make my code more efficient, it seems that I can now see that an if statement isn't a MASSIVE consumption of interrupt time (I do after all only have 14 or so and 2 or three of them are for output clipping, I could probably do this another way?
Unfortunately, the if statements are decided in runtime so I don't think that i'm helping the compiler there. Most are simple statements though. The way i'm processing a sample (lets use bitcrushing for example)
...
Sample
if(BitcrushOn==1){
Sample = (Sample>>BitDepth);
Sample = (Sample<<BitDepth);
}
...
As the above code says, if BitcrushOn = 0, the sample does not get bitcrushed and passes through just fine, most of the if statements in the sample interrupt are like this.
And that is a completely fair assumption, I don't claim to be a good coder at all! Its all part of the learning process for me.
Is there any simple tutorial where I can output my code as ASM to take a look?