static void hottSendTelemetryData(void) { if (!hottIsSending) { hottIsSending = true; // FIXME temorary workaround for HoTT not working on Hardware serial ports due to hardware/softserial serial port initialisation differences if ((portConfig->identifier == SERIAL_PORT_UART1) || (portConfig->identifier == SERIAL_PORT_UART2) || (portConfig->identifier == SERIAL_PORT_UART3)) workAroundForHottTelemetryOnUsart(hottPort, MODE_TX); else serialSetMode(hottPort, MODE_TX); hottMsgCrc = 0; return; } if (hottMsgRemainingBytesToSendCount == 0) { hottMsg = NULL; hottIsSending = false; // FIXME temorary workaround for HoTT not working on Hardware serial ports due to hardware/softserial serial port initialisation differences if ((portConfig->identifier == SERIAL_PORT_UART1) || (portConfig->identifier == SERIAL_PORT_UART2) || (portConfig->identifier == SERIAL_PORT_UART3)) workAroundForHottTelemetryOnUsart(hottPort, MODE_RX); else serialSetMode(hottPort, MODE_RX); flushHottRxBuffer(); return; } --hottMsgRemainingBytesToSendCount; if(hottMsgRemainingBytesToSendCount == 0) { hottSerialWrite(hottMsgCrc++); return; } hottMsgCrc += *hottMsg; hottSerialWrite(*hottMsg++); }
static void hottSendTelemetryData(void) { if (!hottIsSending) { hottIsSending = true; serialSetMode(hottPort, MODE_TX); hottMsgCrc = 0; return; } if (hottMsgRemainingBytesToSendCount == 0) { hottMsg = NULL; hottIsSending = false; serialSetMode(hottPort, MODE_RX); flushHottRxBuffer(); return; } --hottMsgRemainingBytesToSendCount; if(hottMsgRemainingBytesToSendCount == 0) { hottSerialWrite(hottMsgCrc++); return; } hottMsgCrc += *hottMsg; hottSerialWrite(*hottMsg++); }
static void hottSendTelemetryData(void) { if (!hottIsSending) { hottIsSending = true; // FIXME temorary workaround for HoTT not working on Hardware serial ports due to hardware/softserial serial port initialisation differences //serialSetMode(hottPort, MODE_TX); closeSerialPort(hottPort); hottPort = openSerialPort(portConfig->identifier, FUNCTION_TELEMETRY_HOTT, NULL, HOTT_BAUDRATE, MODE_TX, SERIAL_NOT_INVERTED); hottMsgCrc = 0; return; } if (hottMsgRemainingBytesToSendCount == 0) { hottMsg = NULL; hottIsSending = false; // FIXME temorary workaround for HoTT not working on Hardware serial ports due to hardware/softserial serial port initialisation differences //serialSetMode(hottPort, MODE_RX); closeSerialPort(hottPort); hottPort = openSerialPort(portConfig->identifier, FUNCTION_TELEMETRY_HOTT, NULL, HOTT_BAUDRATE, MODE_RX, SERIAL_NOT_INVERTED); flushHottRxBuffer(); return; } --hottMsgRemainingBytesToSendCount; if(hottMsgRemainingBytesToSendCount == 0) { hottSerialWrite(hottMsgCrc++); return; } hottMsgCrc += *hottMsg; hottSerialWrite(*hottMsg++); }
static bool hottSendTelemetryDataByte(timeUs_t currentTimeUs) { static timeUs_t byteSentTimeUs = 0; // Guard intra-byte interval if (currentTimeUs - byteSentTimeUs < HOTT_TX_DELAY_US) { return false; } if (hottTxMsgSize == 0) { // Send CRC byte hottSerialWrite(hottTxMsgCrc); return true; } else { // Send data byte hottTxMsgCrc += *hottTxMsg; hottSerialWrite(*hottTxMsg); hottTxMsg++; hottTxMsgSize--; return false; } }