C in hal
Michael Grunditz (467) 531 posts |
I am thinking of moving clockcalc to C for the VOP, HDMI. |
Tristan M. (2946) 1039 posts |
OK in which respect? If you can get it working correctly, please post results. Definitely not saying it’s not possible. It’s just I couldn’t get it working right is all. |
Jeffrey Lee (213) 6048 posts |
Using C in the HAL should be fine, as long as you know what you’re doing. See Using C in assembler components.
I think most of your problems stemmed from the fact that you were trying to use GCC (and maybe also using C pre-MMU?). I think pretty much every HAL uses at least some C code (via Norcroft) without any major issues. |
Michael Grunditz (467) 531 posts |
I have Done something tests now and it works. But the makefile system tries to build My c code as an application. Howver IF i compiled it manually ie cc -c c.clkconfig IT worked. I missed two functions from clib. Handling division by zero and overflow from division. I just implemented them as dummys. writing on iPad , sorry fot mistakes. |
Michael Grunditz (467) 531 posts |
About global variables . I have some and i havent notice erors from IT. But I have other issues so I think i replace them with #defines . |