major changes to support IAR compiler