thrTraceSrc and potsWarnMode

This commit is contained in:
Raphael Coeffic
2021-11-10 11:07:03 +01:00
parent cc9b146713
commit c6b847c9ac
32 changed files with 257 additions and 60 deletions
@@ -76,6 +76,9 @@ namespace yaml_conv_220 {
bool w_zov_color(void* user, uint8_t* data, uint32_t bitoffs,
yaml_writer_func wf, void* opaque);
bool w_thrSrc(const YamlNode* node, uint32_t val, yaml_writer_func wf,
void* opaque);
};
//
@@ -1179,3 +1182,20 @@ static bool w_logicSw(void* user, uint8_t* data, uint32_t bitoffs,
{
return yaml_conv_220::w_logicSw(user, data, bitoffs, wf, opaque);
}
static uint32_t r_thrSrc(const YamlNode* node, const char* val, uint8_t val_len)
{
auto src = r_mixSrcRaw(nullptr, val, val_len);
auto thrSrc = source2ThrottleSource(src);
if (thrSrc < 0)
return 0;
return thrSrc;
}
static bool w_thrSrc(const YamlNode* node, uint32_t val, yaml_writer_func wf,
void* opaque)
{
return yaml_conv_220::w_thrSrc(node, val, wf, opaque);
}