PUBLIC_API_WEAK

This commit is contained in:
rusefillc 2024-03-24 22:06:58 -04:00
parent 425fc74331
commit 2a114b4f95
6 changed files with 13 additions and 10 deletions

View File

@ -4,7 +4,7 @@
#include "bench_test.h"
__attribute__((weak)) bool fansDisabledByBoardStatus() {
PUBLIC_API_WEAK bool fansDisabledByBoardStatus() {
return false;
}

View File

@ -165,12 +165,12 @@ void onBurnRequest() {
* this hook is about https://github.com/rusefi/rusefi/wiki/Custom-Firmware and https://github.com/rusefi/rusefi/wiki/Canned-Tune-Process
*
*/
__attribute__((weak)) void boardTuneDefaults() { }
PUBLIC_API_WEAK void boardTuneDefaults() { }
__attribute__((weak)) void boardEngineTypeTune(engine_type_e engineType) { }
PUBLIC_API_WEAK void boardEngineTypeTune(engine_type_e engineType) { }
// Weak link a stub so that every board doesn't have to implement this function
__attribute__((weak)) void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) { }
PUBLIC_API_WEAK void boardOnConfigurationChange(engine_configuration_s* /*previousConfiguration*/) { }
/**
* this is the top-level method which should be called in case of any changes to engine configuration

View File

@ -26,7 +26,7 @@ CanWrite::CanWrite()
{
}
__attribute__((weak)) bool boardEnableSendWidebandInfo() { return true; }
PUBLIC_API_WEAK bool boardEnableSendWidebandInfo() { return true; }
void CanWrite::PeriodicTask(efitick_t nowNt) {
UNUSED(nowNt);

View File

@ -44,3 +44,6 @@
// see also validateStack
#define hasLotsOfRemainingStack() (getCurrentRemainingStack() > EXPECTED_REMAINING_STACK)
// this macro helps locate all board API methods
#define PUBLIC_API_WEAK __attribute__((weak))

View File

@ -561,10 +561,10 @@ void startHardware() {
}
// Weak link a stub so that every board doesn't have to implement this function
__attribute__((weak)) void boardInitHardware() { }
__attribute__((weak)) void boardInitHardwareExtra() { }
PUBLIC_API_WEAK void boardInitHardware() { }
PUBLIC_API_WEAK void boardInitHardwareExtra() { }
__attribute__((weak)) void setPinConfigurationOverrides() { }
PUBLIC_API_WEAK void setPinConfigurationOverrides() { }
#if HAL_USE_I2C
const I2CConfig i2cfg = {

View File

@ -228,7 +228,7 @@ bool isStm32F42x() {
// Stubs for per-board low power helpers
__attribute__((weak)) void boardPrepareForStop() {
PUBLIC_API_WEAK void boardPrepareForStop() {
// Default implementation - wake up on PA0 - boards should override this
palEnableLineEvent(PAL_LINE(GPIOA, 0), PAL_EVENT_MODE_RISING_EDGE);
}
@ -261,7 +261,7 @@ void boardPreparePA0ForStandby() {
#endif
}
__attribute__((weak)) void boardPrepareForStandby() {
PUBLIC_API_WEAK void boardPrepareForStandby() {
boardPreparePA0ForStandby();
}