-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add guide for creating your own platform #970
Conversation
6744596
to
625f1d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow that was fast!
It would also be possible to see this as a variation of a platform and only replace the default values, that is only this part.
#pragma once
#define __INCLUDED_FROM_PLATFORM_DEFAULTS__
#ifdef CONFIG_PLATFORM_CF2
#include "platform_defaults_cf2.h"
#endif
#ifdef CONFIG_PLATFORM_BOLT
// Not exactly sure how to do this but use platform_defaults_bolt.h if RINCEWIND is not selected
#ifdef CONFIG_PLATFORM_BOLT_RINCEWIND
#include "platform_rincewind.h"
#else
#include "platform_defaults_bolt.h"
#endif
#endif
#ifdef CONFIG_PLATFORM_TAG
#include "platform_defaults_tag.h"
#endif
It would reduce the complexity and also limit the possibility of messing up settings based on the hardware such as IMU type and motorMap. I'm not sure there is a use case where the hardware conf needs to be changed?
It is not possible with how we do it right now, since |
Instead maybe: #pragma once
#define __INCLUDED_FROM_PLATFORM_DEFAULTS__
#ifdef CONFIG_PLATFORM_CF2
#include "platform_defaults_cf2.h"
#endif
#ifdef CONFIG_PLATFORM_BOLT
#include "platform_defaults_bolt.h"
#endif
#ifdef CONFIG_PLATFORM_TAG
#include "platform_defaults_tag.h"
#endif
#ifdef CONFIG_RINCEWIND
#include "platform_bolt.h"
#include "platform_rincewind.h"
#endif To first include bolt and then rincewind to override or add to what bolt has. |
Looks like a better solution to me :-) |
So, @ntamas the idea we have that is for changing default values of parameters, you add your own platform. For instance for stuff like the critical voltage you added. That would be better as defines in a platform file. So if you create for instance a collmot_defconfig with PLATFORM_COLLMOT we would be able to merge that and you can build by going |
625f1d4
to
951a280
Compare
951a280
to
e3602e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!
Seems OK to me, but does it mean that settings like |
Correct! @tobbeanton will change them as part of his Bolt work. |
No description provided.