How do you handle shared resources in an interrupt service routine (ISR) in embedded firmware for LG Electronics?