28 #if HOTT_SIM_GAM_SENSOR
31 #if HOTT_SIM_EAM_SENSOR
34 #if HOTT_SIM_GPS_SENSOR
35 #include "hott/hott_gps.h"
37 #if HOTT_SIM_VARIO_SENSOR
38 #include "hott/hott_vario.h"
44 #define HOTT_TEXT_MODE_REQUEST_ID 0x7f
45 #define HOTT_BINARY_MODE_REQUEST_ID 0x80
49 #define HOTT_TELEMETRY_GPS_SENSOR_ID 0x8A
51 #define HOTT_TELEMETRY_VARIO_SENSOR_ID 0x89
57 #if HOTT_SIM_GPS_SENSOR
58 bool HOTT_REQ_UPDATE_GPS =
false;
60 #if HOTT_SIM_EAM_SENSOR
61 bool HOTT_REQ_UPDATE_EAM =
false;
63 #if HOTT_SIM_VARIO_SENSOR
64 bool HOTT_REQ_UPDATE_VARIO =
false;
66 #if HOTT_SIM_GAM_SENSOR
67 bool HOTT_REQ_UPDATE_GAM =
false;
75 #if HOTT_SIM_GAM_SENSOR
78 #if HOTT_SIM_EAM_SENSOR
81 #if HOTT_SIM_GPS_SENSOR
82 static struct HOTT_GPS_MSG hott_gps_msg;
84 #if HOTT_SIM_VARIO_SENSOR
85 static struct HOTT_VARIO_MSG hott_vario_msg;
94 #if HOTT_SIM_EAM_SENSOR
97 #if HOTT_SIM_GAM_SENSOR
100 #if HOTT_SIM_GPS_SENSOR
101 hott_init_gps_msg(&hott_gam_msg);
103 #if HOTT_SIM_VARIO_SENSOR
104 hott_init_vario_msg(&hott_gam_msg);
106 #if HOTT_SIM_TEXTMODE
107 hott_init_text_msg(&hott_gam_msg);
131 #if HOTT_SIM_EAM_SENSOR
133 HOTT_REQ_UPDATE_EAM ==
TRUE) {
135 HOTT_REQ_UPDATE_EAM =
false;
138 #if HOTT_SIM_GAM_SENSOR
140 HOTT_REQ_UPDATE_GAM ==
TRUE) {
142 HOTT_REQ_UPDATE_GAM =
false;
145 #if HOTT_SIM_GPS_SENSOR
147 HOTT_REQ_UPDATE_GPS ==
TRUE) {
148 hott_update_gps_msg(&hott_gam_msg);
149 HOTT_REQ_UPDATE_GPS =
false;
152 #if HOTT_SIM_VARIO_SENSOR
154 HOTT_REQ_UPDATE_VARIO ==
TRUE) {
155 hott_update_vario_msg(&hott_gam_msg);
156 HOTT_REQ_UPDATE_VARIO =
false;
199 static uint32_t hott_serial_request_timer = 0;
203 if (hott_serial_request_timer == 0) {
204 hott_serial_request_timer = tnow;
207 if (tnow - hott_serial_request_timer < 4600) {
210 hott_serial_request_timer = 0;
216 #if HOTT_SIM_TEXTMODE
220 hott_txt_msg.start_byte = 0x7b;
221 hott_txt_msg.stop_byte = 0x7d;
223 if (tmp == (HOTT_SIM_TEXTMODE_ADDRESS & 0x0f)) {
224 HOTT_Clear_Text_Screen();
225 HOTT_HandleTextMode(addr);
226 hott_send_text_msg();
232 #if HOTT_SIM_EAM_SENSOR
235 HOTT_REQ_UPDATE_EAM =
true;
239 #if HOTT_SIM_GAM_SENSOR
242 HOTT_REQ_UPDATE_GAM =
true;
246 #if HOTT_SIM_GPS_SENSOR
249 HOTT_REQ_UPDATE_GPS =
true;
253 #if HOTT_SIM_VARIO_SENSOR
256 HOTT_REQ_UPDATE_VARIO =
true;
269 hott_serial_request_timer = 0;
281 if (tnow - hott_serial_timer < 3000) {
288 hott_serial_timer = tnow;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint8_t uart_getch(struct uart_periph *p)
bool autopilot_get_motors_on(void)
get motors status
static void hott_msgs_init(void)
Initializes a HoTT GPS message (Receiver answer type !Not Smartbox)
uint16_t uart_char_available(struct uart_periph *p)
Check UART for available chars in receive buffer.
static void hott_periodic_event(uint32_t tnow)
static void hott_check_serial_data(uint32_t tnow)
#define HOTT_TELEMETRY_GAM_SENSOR_ID
static void hott_init_gam_msg(struct HOTT_GAM_MSG *hott_gam_msg)
#define HOTT_TEXT_MODE_REQUEST_ID
void uart_periph_set_mode(struct uart_periph *p, bool tx_enabled, bool rx_enabled, bool hw_flow_control)
Set mode (not necessary, or can be set by SerialConfig)
static void hott_update_eam_msg(struct HOTT_EAM_MSG *hott_eam_msg)
static int16_t hott_msg_len
Architecture independent timing functions.
static bool hott_telemetry_is_sending
static void hott_send_telemetry_data(void)
static void hott_enable_transmitter(void)
#define HOTT_BINARY_MODE_REQUEST_ID
static void hott_enable_receiver(void)
void uart_put_byte(struct uart_periph *p, long fd, uint8_t data)
Uart transmit implementation.
#define HOTT_TELEMETRY_EAM_SENSOR_ID
static uint32_t hott_event_timer
#define HOTT_TELEMETRY_VARIO_SENSOR_ID
Graupner HOTT electric air module description.
static void hott_send_msg(int8_t *buffer, int16_t len)
static int8_t * hott_msg_ptr
#define HOTT_TELEMETRY_GPS_SENSOR_ID
#define SysTimeTimerStart(_t)
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
static void hott_init_eam_msg(struct HOTT_EAM_MSG *hott_eam_msg)
static void hott_update_gam_msg(struct HOTT_GAM_MSG *hott_gam_msg)
static uint16_t hott_telemetry_sendig_msgs_id