Hi guys. I'm using interrupts for UART receiver and Comparator. Since, I already solved my previous problem. I would like to ask if it's okay to place function calls inside an interrupt routine? Thanks
Last edited:
Yes, I was thinking a more basic program, as you are just getting started with interrupts. Once you have a solid understanding of running multiple things and having it work, you will be more confident and able to write code such as AlexR has described.Thank you for your reply thatoneguy,
So it means that I have to check the flags always in a never ending loop? Will it consume a lot of battery?
Supposedly I provide these choices. What do you think is better?
1. while(1) loop is empty; interrupt function is handling functions for uart and for comparator, designated functions are called inside the interrupt function.
2. while(1) loop has the flags, interrupt functions only set flags for uart and for comparator, designated functions will then be called inside the main program.
3. while(1) contains if statements for checking uart received characters; uart receive interrupt is disabled and the only interrupt enabled is comparator
Which also will consume more power? I'm aiming for a program that can save its power.
by Duane Benson
by Aaron Carman
by Jake Hertz
by Aaron Carman