simple ide c inline asm waitcnt problem
Mart1970
Posts: 23
First hello to everybody.
Iam trying to make the inline asm waitcnt to work.
But whate i do it's seems to stay in a delay off 1 second.
code:
while(1)
{
int time;
unsigned int delay;
__asm__("mov r1, #0xff\n\t"
"shl r1, #16\n\t"
"or dira, r1\n\t"
"or outa, r1\n\t"
"rdlong r2, #0\n\t"
"add r2, cnt\n\t"
"waitcnt r2, %[delay]\n\t"
"andn outa, r1\n\t"
"strloop:"
"rdlong r2, #\n\t"
"add r2, cnt\n\t"
"waitcnt r2, %[delay]\n\t"
"or outa, r1\n\t"
"if_nz brs #strloop\n\t"
:
: /*inputs */
[delay] "r" (delay),
[time] "r" (time)
);
}
Hope someone can help me .
Thanks
Iam trying to make the inline asm waitcnt to work.
But whate i do it's seems to stay in a delay off 1 second.
code:
while(1)
{
int time;
unsigned int delay;
__asm__("mov r1, #0xff\n\t"
"shl r1, #16\n\t"
"or dira, r1\n\t"
"or outa, r1\n\t"
"rdlong r2, #0\n\t"
"add r2, cnt\n\t"
"waitcnt r2, %[delay]\n\t"
"andn outa, r1\n\t"
"strloop:"
"rdlong r2, #\n\t"
"add r2, cnt\n\t"
"waitcnt r2, %[delay]\n\t"
"or outa, r1\n\t"
"if_nz brs #strloop\n\t"
:
: /*inputs */
[delay] "r" (delay),
[time] "r" (time)
);
}
Hope someone can help me .
Thanks
Comments