setPinOutput(PIN_LED2);
We, of course don't have to do anything. That code is easily changeable if/when something better is available.
If you don't like that, don't look at some of the more recent updates I just pushed.
You mean "setup()" and "main()"? Well ...
Yep, I was referring to the #include "pdkuino.h" at the top that moves main() out of the main .c file and assumes you will instead implement setup() and loop() methods.
Of course an optional Arduino-like include could not hurt.
But I was thinking there is a lack of consistency in the general toolchains that exist around PDK. It would be good to have at least one point of reference that we can all agree on extending on together. (olbigatory: https://xkcd.com/927/)
There are now at least 4 different repositories that have examples sitting somewhere in a deeply nested folder. All of them based on a different set of system includes. But as someone wanting to start development, it is simply a pain to find somethign that is consistent.
I agree. But we aren't there yet. I did start working on a refactoring of the include files on a branch in the easy-pdk-programmer-software repo earlier today, with a goal of trying to clean it up a bit, make it more extensible, and separate out the easy-pdk specific code from the more general pdk stuff that maybe could eventually be packaged into SDCC. If you have a chance, take a look and provide feedback on the (work-in-progress) pull request:
https://github.com/free-pdk/easy-pdk-programmer-software/pull/33. Please keep in mind this isn't 'finished' or 'ready to use' yet, and maybe not all the ideas I was playing around with are good ideas, so please be gentle.
Even if I do go the pdkuino route with my repo, it would ideally just be a layer on top of the base pdk include files, not a replacement for them.
For example, there are still glaring issues when trying to use "printf" (Some of the examples use "puts" for a reason) . I implemented some optimized routines that took a lot of effort, to be at least able to do basic printf-style debugging (https://github.com/cpldcpu/SimPad/blob/master/Toolchain/library/PDK_softuart.c), but there is simply no place to put them oither than my own repositiy.
I also still don't know how to build a librariy with conditional linking of functions to be able to cope with the limited program memory.
Yeah, the limited resources are definitely something we have to find a way to manage. I haven't tried to use printf-style debugging yet, mostly because I assumed it would be too resource intensive. For the things I have been playing around with so far, a logic analyzer is actually more useful anyway.
For SDCC, the only way I have found for it to have conditional linking (or exclusion of unused functions) is if each one is in it's own file and compiled into a library. I think the SDCC manual mentions that somewhere. My toolchain is setup in this fashion, although it's hard to see it working since I only have one library file checked in so far.
Could we agree on starting a new repository on "free-pdk" that contains a central repository for the toolchain and examples? (Also looking at JS and Phillipp)
I personally don't have access to the free-pdk repos to start something like that, but would be happy to collaborate there if that was setup.