• Welcome to Andy's Workshop Forums. Please login or sign up.
 
September 26, 2020, 02:55:01 pm

News:

SMF - Just Installed!


Why stm32Plus is not fully header-only?

Started by zupazt3, March 14, 2017, 05:59:30 am

Previous topic - Next topic

zupazt3

Hi,

I'm just wondering: why isn't stm32plus fully header-only library? A lot of functions are inline and are included in *.h but some are in *.cpp.

Why is that? What are the props? What's the reasoning behind this?

I'm thinking about exercising a bit by writing my own library and I wonder why shouldn't I do it all as header-only?

Andy Brown

Hi, it's really because the library evolved over the years towards header-only. If you're writing your own library then header only is the way to go in my opinion.

Watch out though for interrupt handlers. They must remain anchored to a fixed address so that the address can be inserted into the vector table.
It's worse than that, it's physics Jim!