The #pragma interrupt_level directive can be used to prevent duplication of functions called from main-line and interrupt code (see Disabling Duplication).
#pragma interrupt_level