liblpc2000_iap_command documenation?

Comments

1 comment

  • Avatar
    Jon Elliott

    There are a some words in the liblpc1000.h header file describing the liblpc2000_iap_command function - there isn't much too it, here is the implementation:

    #include "liblpc2000.h"
    
    #define IAP_LOCATION 0x7FFFFFF1
    
    typedef void (*IAP)(unsigned long [], unsigned long[]);
    
    unsigned long
    liblpc2000_iap_command(unsigned long cmd, unsigned long p0, unsigned long p1, unsigned long p2, unsigned long p3, unsigned long *r0)
    {
      unsigned long command[5] = {cmd, p0, p1, p2, p3};
      unsigned long result[2];
      ((IAP)IAP_LOCATION)(command, result);
      if (r0)
        *r0 = result[1];
      return result[0];
    }

    I think the problem you are observing is because you are using libarm_isr_enable_irq and libarm_isr_disable_irq rather than libarm_enable_irq and libarm_disable_irq - the former functions are used for re-enabling interrupts from within an ISR and change the processor mode (and therefore the current stack).

    0
    Comment actions Permalink

Please sign in to leave a comment.