view Small_CPU/Inc/wireless.h @ 173:05c770dc2911 max-depth

Bugfix: make max depth move with current depth (part 1) The display in dive mode of the max depth was updated before the actual depth, which looks very strange. The reason for this was conceptually simple. The depth value was averaged over a set of depth samples, but the current depth was only taken from the current sample. So, per definition, on an initial descend, the current depth is always bigger (deeper) than any average from previous shallower samples. This part 1 commit introduces a new function that is used immediate after reception of the new sample from the RTE. This function does the trivial average of a set of samples. Notice that also the surface and ambient mbar pressures are taken into account (which are used heavily over the entire code). This is a consistency thing. We should base any further calculation from the data presented in the UI, instead of presenting A, and use A' for further calculations. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Mon, 11 Mar 2019 19:48:57 +0100
parents 5f11787b4f42
children
line wrap: on
line source

/**
  ******************************************************************************
  * @file    wireless.h
  * @author  heinrichs weikamp gmbh
  * @date    02-July-2015
  * @version V0.0.1
  * @since   02-July-2015
  * @brief   Data transfer via magnetic field using Manchester code
  *           
  @verbatim                 
  ============================================================================== 
                        ##### How to use #####
  ============================================================================== 
  @endverbatim
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT(c) 2015 heinrichs weikamp</center></h2>
  *
  ******************************************************************************
  */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef WIRELESS_H
#define WIRELESS_H

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>

void wireless_init(void);

void wireless_trigger_FallingEdgeSignalHigh(void);
void wireless_trigger_RisingEdgeSilence(void);
	 
uint8_t wireless_evaluate(uint8_t *dataOut, uint8_t maxData, uint8_t *confidence);
uint8_t wireless_evaluate_crc_error(uint8_t *dataIn, uint8_t maxData);
	 
#ifdef __cplusplus
}
#endif

#endif /* WIRELESS_H */

/************************ (C) COPYRIGHT heinrichs weikamp *****END OF FILE****/