[PATCH 4/4] Add EON Steel bookmarks, warnings and alarm events
Jef Driesen
jef at libdivecomputer.org
Tue Jan 6 11:47:24 PST 2015
On 04-01-15 01:34, Linus Torvalds wrote:
> +static void sample_event_alarm_type(struct sample_data *info, unsigned char type)
> +{
> + info->alarm_type = type;
> +}
> +
> +
> +static void sample_event_alarm_value(struct sample_data *info, unsigned char value)
> +{
> + dc_sample_value_t sample = {0};
> + static const enum parser_sample_event_t translate_alarm[] = {
> + SAMPLE_EVENT_CEILING_SAFETYSTOP, // 0=Mandatory Safety Stop Broken
> + SAMPLE_EVENT_ASCENT, // 1=Ascent Speed
> + SAMPLE_EVENT_NONE, // 2=Diluent Hyperoxia
> + SAMPLE_EVENT_VIOLATION, // 3=Violated Deep Stop
> + SAMPLE_EVENT_CEILING, // 4=Ceiling Broken
> + SAMPLE_EVENT_PO2, // 5=PO2 High
> + SAMPLE_EVENT_PO2, // 6=PO2 Low
> + };
> +
> + if (info->alarm_type > 6)
> + return;
> +
> + sample.event.type = translate_alarm[info->alarm_type];
> + if (sample.event.type == SAMPLE_EVENT_NONE)
> + return;
> +
> + sample.event.value = value ? SAMPLE_FLAGS_BEGIN : SAMPLE_FLAGS_END;
> + if (info->callback) info->callback(DC_SAMPLE_EVENT, sample, info->userdata);
> +}
These functions aren't used anywhere. Is that on purpose, or is there something
missing in the patch?
Once this has been clarified, I'll commit your patches. Except for the dive mode
and personal adjustment patches, because these two rely on the string api which
isn't available yet.
Jef
More information about the devel
mailing list