Closed maraflush closed 8 months ago
looking at this ive started to get confused how this all works. online i can only find examples that set the target without the . in the name, and ive been using the same in starstruck. '.arm' or '.thumb' also works?
Yes, you can force the compiler to use thumb or arm with this update like
THUMB_CODE u16 sum_function() {
u16 i;
u16 sum = 0;
for (i = 0 ; i < 10 ; i++) {
sum += 1;
}
return sum;
}
looking at this ive started to get confused how this all works. online i can only find examples that set the target without the . in the name, and ive been using the same in starstruck. '.arm' or '.thumb' also works?
How you use this .arm
and .thumb
in C code ?
It's target("arm")
and target("thumb")
. See GCC ARM function attributes and libseven's macros.
It's
target("arm")
andtarget("thumb")
. See GCC ARM function attributes and libseven's macros.
^this is what i meant^ https://github.com/DacoTaco/StarStruck/blob/master/kernel/source/scheduler/threads.c#L139-L140 (and i know this works because its executing arm only instructions and the project is set to build as thumb unless specified otherwise)
ah ok ! thanks !
it's better thanks.
Hello,
Sometimes, I need to change my code with thumb or arm mode for specific usage. These attributes can help for us.
Regards,