PUBLIC_API_WEAK or BOARD_WEAK #6748

This commit is contained in:
Andrey 2024-07-27 12:04:16 -04:00 committed by rusefillc
parent 27a76a6d04
commit e902e9cb81
2 changed files with 7 additions and 4 deletions

View File

@ -1106,13 +1106,13 @@ void commonFrankensoAnalogInputs() {
// These symbols are weak so that a board_configuration.cpp file can override them
BOARD_WEAK void setBoardDefaultConfiguration() { }
// specific firmware builds are meant for specific hardware. In order to provide best user experience on well-known boards sometimes we reduce user flexibility.
BOARD_WEAK void setBoardConfigOverrides() { }
BOARD_WEAK_SOMETHING_WEIRD void setBoardConfigOverrides() { }
BOARD_WEAK int hackHellenBoardId(int detectedId) { return detectedId; }
BOARD_WEAK void onBoardStandBy() { }
BOARD_WEAK int getBoardMetaOutputsCount() { return 0; }
BOARD_WEAK_SOMETHING_WEIRD int getBoardMetaOutputsCount() { return 0; }
// default implementation: treat all outputs as low side
BOARD_WEAK int getBoardMetaLowSideOutputsCount() { return getBoardMetaOutputsCount(); }
BOARD_WEAK Gpio* getBoardMetaOutputs() { return nullptr; }

View File

@ -23,11 +23,14 @@
#if !defined(EFI_SIM_IS_WINDOWS) || !EFI_SIM_IS_WINDOWS
// todo: dup of PUBLIC_API_WEAK?
#define BOARD_WEAK __attribute__((weak))
#define BOARD_WEAK_SOMETHING_WEIRD __attribute__((weak))
#else
#define BOARD_WEAK
#define BOARD_WEAK_SOMETHING_WEIRD
#endif
// todo: dup of PUBLIC_API_WEAK?
#define BOARD_WEAK __attribute__((weak))
void setCrankOperationMode();
void setCamOperationMode();
void setTwoStrokeOperationMode();