-
Notifications
You must be signed in to change notification settings - Fork 67
Introduce hardware abstraction layer #64
base: main
Are you sure you want to change the base?
Conversation
src/ds1302.c:123: warning 158: overflow in implicit constant conversion
Hello ? Any problem with merging this ? It's been a while.. |
hi @orzel sorry, I may have missed the PR when it was opened. I haven't done much with this project in the past year or so since my desk clocks have been mostly stable. |
Nope, never tried platformio on this project. There's not much information on https://github.com/orzel/stc_diyclock#platformio-support
|
Signed-off-by: Thomas Capricelli <capricelli@sylphide-consulting.com>
Thanks. So yes for building with platformio, you can either install and run directly from cli as you have seen (akin to traditional toolchain like make, etc), or the better way (IMHO) is running platformio in Visual Studio Code. When I attempt to run this, I'm getting a number of errors, likely because the way platformio works, is that you can also define different target "environments", i.e. for different boards/hardward variants, etc. Because you are handling this via some defines inside the HAL stuff, I think we just need to update each of the "environments" (really target hardware families/variants), with appropriate C build flags for each, per: https://docs.platformio.org/en/stable/projectconf/section_env_build.html#examples currently getting:
|
Clarifying a bit further, platformio is independent from make, meaning it doesnt see or use anything in the Makefile. So if we have some mandatory new define, it would need to be set somehow (likely via build_flags) in the platformio.ini. NB: inside the intel_mcs51 platform there are board definitions which already take care of settings some of the particular things you'd previously had to manage explicitly setting in the makefile when passing options to sdcc/etc, e.g. what we currently pass as STCCODESIZE or SDCCOPTS in makefile come to mind. example: https://github.com/platformio/platform-intel_mcs51/blob/develop/boards/STC15W408AS.json But application logic like HARDWARE define is something we need to pass explicitly (i.e. build_flags) via platformio.ini, unless there is already some reasonable default inside the code/macros itself. |
just a quick test, I was able to add this to
and it did build (with some other warnings), but I have not checked functionality. (Note the single quote wrapping doublequotes is important here.)
|
Ok. I see. platformio.ini doesn't seem to be specific to vscode, is it ? Rather to platformio, no ?
|
correct, platformio is the build system, think of it as replacing make. It has very good integration with VSCode, but can be run standalone from cli. Yes unfortunately, the different mcus (usually one of stc15f204ea, stc15w404as, stc15w408as) have been seen mixed and matched with different actual hardware variants (differing pinouts/pcb, and in some cases different peripherals). |
Provides a better way to specify different hardware targets (+some misc fixes)