I took a quick look for any reference to related subjects on the web reference and forum topics, so if I overlooked any cite to this my apologies in advance.
Is there a runtime hook in the firmware that I can leverage for target device conditionals?
Example:
if (Photon) perform_Photon_operation;
else if (P1) perform_P1_operation;
else none_of_the_above;
So you have a Product that has two hardware implementations?
Yes sir.
And I’d like a single code base.
Bear
May 14, 2018, 5:57pm
4
Try a search on a compiler directive “PLATFORM_ID”.
Thanks Bear!
Directives work too!
Bookmarked for future reference:
/**
******************************************************************************
* @file platforms.h
* @authors Matthew McGowan, Brett Walach
* @date 02 February 2015
******************************************************************************
Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
This file has been truncated. show original