On 21.01.2015 19:36, Georg Icking-Konert wrote: > hello all, > > I am currently trying to port the STM8S Standard Peripheral Library to > SDCC > (http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC1807/SS1754/PF258009). > If I succeed it would open up the whole range of examples and libs > available on the STM homepage. In addition, since the STM32 SPL is very > similar, it would provide an easy transition path from STM8/sdcc to > STM32/gcc and back. If/when it works I will make the code available as a > patch since the SPL license prohibits distributing the source code, > modified or not :-( > > Anyway, right now I got stuck at 2 points for which you can hopefully > help me: > > 1) how do I declare and implement the trap handler? According > to http://sourceforge.net/p/sdcc/patches/224/ the keyword "__trap“ is > available via patch (2014-02-22). Is this already part of 3.4.0 (#8981; > 2014-04-5) and, if yes, how do I use it? If not, is it planned for the > next release which is due when? > > 2) in the function declaration Cosmic, IAR and Resonance all have the > respective interrupt token before the function name. Therefore the SPL > does it as follows: > stm8s.h: #define INTERRUPT __interrupt > stm8s_it.h: INTERRUPT void AWU_IRQHandler(void); > Unfortunately SDCC expects the keyword „__interrupt“ after the function > name, e.g. "void TIM4_ISR(void) __interrupt(23);“. Is there any way to > modify macro INTERRUPT in stm8s.h so that the keyword is attached to a > line, even though it uses no brackets? If not, it won’t be 100% > compatible (i.e. without change) with the examples and other STM libs - > which is my target… > > I’m sure there will be more issues, but that’s it for today. For your > kind support thanks a lot in advance! > > Greetings, > Georg Icking-Konert
Can't you create a macro for declaring itnerrupt handlers for this issue? Or just have two declarations with #ifdef? I guess, your changes would also be welcome upstream (STM). Philipp
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user