In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before ':' token
What is wrong in this functons ?
Reply by FreeRTOS Info●September 10, 20092009-09-10
> In Crossstudio 1.7 this functions works correctly:
> static inline cpu_t get_cpsr(void)
> {
> cpu_t val;
> asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
> return val;
> }
>
> static inline void set_cpsr(cpu_t val)
> {
> asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
> }
>
> In Crossstudio 2.0 I have error:
> 'asm' undeclared (first use in this function)
> when I remove volatile keyword, I have error
> asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
> ^ expected ')' before ':' token
> What is wrong in this functons ? Either switch off the "force ANSI compliance" compiler option, or
replace
asm with __asm.
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.
+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.
Reply by tomi●September 10, 20092009-09-10
In Crossstudio 1.7 this functions works correctly:
static inline cpu_t get_cpsr(void)
{
cpu_t val;
asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
return val;
}
In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before
':' token
What is wrong in this functons ?