Comments (4)
Yes, I noticed that a few weeks ago.
It caused some really annoying bugs that were hard to track down as well.
Because we usually setup and calibrate the clock in this function, it means that pretty much every program written for these Padauk MCUs will probably have to be updated, or they will (silently) fail to operate properly.
For now, I've been using this in some of my projects:
#if __SDCC_REVISION >= 13762
unsigned char __sdcc_external_startup(void) {
#else
unsigned char _sdcc_external_startup(void) {
#endif
...
}
But that is pretty ugly.
Maybe @spth has some ideas for a better way to handle this (ideally some kind of backward compatibility inside SDCC itself?
I suppose worst case we could to a conditional define in one of the common header files to implement backwards compatibility with a compiler warning maybe.
Something like this (in one of the include files) would probably work:
#if __SDCC_REVISION >= 13762
#define _sdcc_external_startup __sdcc_external_startup
#warning "Update to the newer __sdcc_external_startup syntax!"
#endif
But, that won't help someone that just updates SDCC without pulling in new include files.
from free-pdk-examples.
ideally some kind of backward compatibility inside SDCC itself?
I would predict that it's unlikely.
Unfortunately for the PDK platform, the init code is generated by the compiler, rather than like on some other platforms where it is a separate, override-able, crt0 library that's linked in, so defines are probably going to be the only option.
Your solution involving the include file warning sounds good to me. Maybe reverse it so that it warns to update the version of SDCC.
BTW, I was motivated to file this issue because I have been referring to the FreePDK website documentation while putting together a patch to unify __sdcc_external_startup
behaviour across platforms. Did you know that no platform other than MCS51 actually acted on the return value from __sdcc_external_startup
? If my patch is accepted, the PDK platform will also respect the return value and skip GSINIT code if required.
from free-pdk-examples.
Looks like a 'fix' for SDCC feature request #868 has been implemented with commit r13850.
from free-pdk-examples.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from free-pdk-examples.