update libfirmware (#169)

* update

* fragments

* livedata

* livedata
This commit is contained in:
Matthew Kennedy 2022-12-01 13:50:21 -08:00 committed by GitHub
parent d2f676c704
commit 5824028b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 16 deletions

@ -1 +1 @@
Subproject commit ba9e280fc477c577dda124981b52f6108ff43015 Subproject commit 16a8e0b636f0a8d5f88dfdd6a1a4639ad90da936

View File

@ -33,24 +33,29 @@ void SamplingUpdateLiveData()
livedata_common.vbatt = GetInternalBatteryVoltage(0); livedata_common.vbatt = GetInternalBatteryVoltage(0);
} }
const livedata_common_s * getCommonLiveDataStructAddr() template<>
const livedata_common_s* getLiveData(size_t)
{ {
return &livedata_common; return &livedata_common;
} }
const struct livedata_afr_s * getAfrLiveDataStructAddr(const int ch) template<>
const struct livedata_afr_s * getLiveData(size_t ch)
{ {
if (ch < AFR_CHANNELS) if (ch < AFR_CHANNELS)
{
return &livedata_afr[ch]; return &livedata_afr[ch];
return NULL; }
return nullptr;
} }
static const FragmentEntry fragments[] = { static const FragmentEntry fragments[] = {
getCommonLiveDataStructAddr(), decl_frag<livedata_common_s>{},
getAfrLiveDataStructAddr(0), decl_frag<livedata_afr_s, 0>{},
getAfrLiveDataStructAddr(1), decl_frag<livedata_afr_s, 1>{},
getEgtLiveDataStructAddr(0), decl_frag<livedata_egt_s, 0>{},
getEgtLiveDataStructAddr(1) decl_frag<livedata_egt_s, 1>{},
}; };
FragmentList getFragments() { FragmentList getFragments() {

View File

@ -2,6 +2,8 @@
#include <stdint.h> #include <stdint.h>
#include <rusefi/fragments.h>
#include "wideband_config.h" #include "wideband_config.h"
/* +0 offset */ /* +0 offset */
@ -34,7 +36,3 @@ struct livedata_afr_s {
/* update functions */ /* update functions */
void SamplingUpdateLiveData(); void SamplingUpdateLiveData();
/* access functions */
const struct livedata_common_s * getCommonLiveDataStructAddr();
const struct livedata_afr_s * getAfrLiveDataStructAddr(const int ch);

View File

@ -144,7 +144,8 @@ Max31855* getEgtDrivers() {
return instances; return instances;
} }
const struct livedata_egt_s * getEgtLiveDataStructAddr(const int ch) template<>
const livedata_egt_s* getLiveData(size_t ch)
{ {
if (ch < EGT_CHANNELS) if (ch < EGT_CHANNELS)
return &getEgtDrivers()[ch].livedata; return &getEgtDrivers()[ch].livedata;
@ -153,9 +154,10 @@ const struct livedata_egt_s * getEgtLiveDataStructAddr(const int ch)
#else #else
const struct livedata_egt_s * getEgtLiveDataStructAddr(const int) template<>
const livedata_egt_s* getLiveData(size_t)
{ {
return NULL; return nullptr;
} }
#endif /* EGT_CHANNELS > 0 */ #endif /* EGT_CHANNELS > 0 */