This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Usb bootloader with LPC2148

Hi Friends,

I'm trying to read cpsr and set cpsr with these function. however these functions works fine in eclipse but i have problem using them in keil uvision 4.

static inline unsigned __get_cpsr(void)
{ unsigned long retval; asm volatile (" mrs %0, cpsr" : "=r" (retval) : ); return retval;
}

static inline void __set_cpsr(unsigned val)
{ asm volatile (" msr cpsr, %0": :"r" (val));
} and i get this error:

error: #65: expected a ";"
error: #20: identifier "asm" is undefined
so i used __inline and __asm and now i get this error:

source\main.c(94): error: #18: expected a ")"
source\main.c(94): error: #18: expected a ")"
Any idea on how to fix it? or what is the steps to move these functions in a separate asm file which seems to be a solution.

Thanks
robo

Parents Reply Children
No data