Dealing with __ASM

45 views
Skip to first unread message

diff storm

unread,
Feb 15, 2023, 4:08:48 PM2/15/23
to ThrowTheSwitch Forums
Hi all,

I try to mock the static inline functions in the following header file:


After the __ASM line in the link there is ARM assembly commands which gcc gives errors such as "no such instruction ...."
I want somehow to get rid of the __ASM parts or just mock the static inline function properly.

Is there a way to do it?

I have already tried the :defines and :strippables but no luck, I am not sure :strippables works or not, it seems it does not do anything.
In my case __ASM is a define and I can change it to something, but it does not help because the volatile ("cpsie i" : : : "memory"); part remains.

Thanks

Paul V

unread,
Oct 14, 2023, 12:48:52 PM10/14/23
to ThrowTheSwitch Forums
One possibility would be to replace the whole header file with your own containing the function prototypes your code needs.

You want to stub or mock the hardware dependencies. Since the ARM header file contains the hardware close code, that file must be excluded from the build process. 

Christian Cortes

unread,
Oct 18, 2023, 2:35:26 PM10/18/23
to ThrowTheSwitch Forums
since you simply want to mock the inline functions, you can just comment out the portion that defines the functions and add a semicolon at the end. That is what i do and works all the time since mocking does not care at all about the implementation of the function. 
Reply all
Reply to author
Forward
0 new messages