Hello There's one source file which contais several functions. Some of functions should be generated ARM mode code and the other functions should be generated thumb code. I read the examples of interworking in the Keil MDK and I found that it is easy to set all the functions in one file to generate ARM code. But I didn't found how to set part of the functions to generate ARM code. In IAR, there's a keyword named __arm which sets the function to generate ARM code. Is there a similar keyword in Keil MDK? Who can tell me how to do it? Thanks.
There are two pragmas (described in the user manual):
#pragma arm #pragma thumb
//... #pragma push // save current mode #pragma arm // use arm mmode int iAdd_A (int i1, int i2, int i3, int i4) { return (i1 + i2 + i3 + i4); } #pragma thumb // use thumb mode int iAdd_T (int i1, int i2, int i3, int i4) { return (i1 + i2 + i3 + i4); } #pragma pop // restore previous mode int main (void) { //... }