I have such problem:
I would like to write method (for S12X) what will be exam if is called from ISR or task. let me show example:
* Metod return TRUE if called from ISR or FALSE if called from task
extern bool S12X_ISR_context(void);
bool context = S12X_ISR_context(); //return TRUE due called from ISR!
bool context = S12X_ISR_context(); //return FALSE due called from main
Am I clear enough?
1. Is it possible to implement testing IPL bits in CCR register?
I found in datasheet such picture (attached below), but:
2. I do not know details of S12X core so please someone check it if I am going right way..
3. How to read to stack located variable IPL bits?