535 static uint8_t smartPortIdCycleCnt = 0;
538 static uint8_t skipRequests = 0;
539#ifdef USE_ESC_SENSOR_TELEMETRY
540 static uint8_t smartPortIdOffset = 0;
543#if defined(USE_MSP_OVER_TELEMETRY)
546 }
else if (payload && smartPortPayloadContainsMSP(payload)) {
551 smartPortMspReplyPending = handleMspFrame(frameStart, SMARTPORT_MSP_PAYLOAD_SIZE, &skipRequests);
558 *clearToSend =
false;
570 while (doRun && *clearToSend && !skipRequests) {
572 if (requestTimeout) {
574 *clearToSend =
false;
582#if defined(USE_MSP_OVER_TELEMETRY)
583 if (smartPortMspReplyPending) {
584 smartPortMspReplyPending = sendMspReply(SMARTPORT_MSP_PAYLOAD_SIZE, &smartPortSendMspResponse);
585 *clearToSend =
false;
594#ifdef USE_ESC_SENSOR_TELEMETRY
595 if (smartPortIdCycleCnt >= ESC_SENSOR_PERIOD) {
597 tableInfo = &frSkyEscDataIdTableInfo;
598 if (tableInfo->
index == tableInfo->
size) {
599 tableInfo->
index = 0;
600 smartPortIdCycleCnt = 0;
602 if (smartPortIdOffset == getMotorCount() + 1) {
603 smartPortIdOffset = 0;
607 if (smartPortIdCycleCnt < ESC_SENSOR_PERIOD) {
611 if (tableInfo->
index == tableInfo->
size) {
612 tableInfo->
index = 0;
614#ifdef USE_ESC_SENSOR_TELEMETRY
618#ifdef USE_ESC_SENSOR_TELEMETRY
619 if (smartPortIdCycleCnt >= ESC_SENSOR_PERIOD) {
620 id += smartPortIdOffset;
623 smartPortIdCycleCnt++;
631#ifdef USE_ESC_SENSOR_TELEMETRY
632 escSensorData_t *escData;
643 *clearToSend =
false;
645#ifdef USE_ESC_SENSOR_TELEMETRY
655 if (escData != NULL) {
657 *clearToSend =
false;
663 *clearToSend =
false;
665#ifdef USE_ESC_SENSOR_TELEMETRY
675 if (escData != NULL) {
677 *clearToSend =
false;
681 escData = getEscSensorData(ESC_SENSOR_COMBINED);
682 if (escData != NULL) {
684 *clearToSend =
false;
696 if (escData != NULL) {
698 *clearToSend =
false;
702 escData = getEscSensorData(ESC_SENSOR_COMBINED);
703 if (escData != NULL) {
705 *clearToSend =
false;
717 if (escData != NULL) {
719 *clearToSend =
false;
725 *clearToSend =
false;
729 *clearToSend =
false;
733 *clearToSend =
false;
737 *clearToSend =
false;
740 case FSSP_DATAID_ACCX :
742 *clearToSend =
false;
744 case FSSP_DATAID_ACCY :
746 *clearToSend =
false;
748 case FSSP_DATAID_ACCZ :
750 *clearToSend =
false;
761 tmpi = t1Cnt * 10000;
793 *clearToSend =
false;
799 uint16_t hdop = constrain(scaleRange(gpsSol.hdop, 100, 550, 9, 0), 0, 9) * 100;
800 smartPortSendPackage(
id, (STATE(GPS_FIX) ? 1000 : 0) + (STATE(GPS_FIX_HOME) ? 2000 : 0) + hdop + gpsSol.numSat);
801 *clearToSend =
false;
804 *clearToSend =
false;
836 *clearToSend =
false;
840#if defined(USE_ADC_INTERNAL)
843 *clearToSend =
false;
848 if (STATE(GPS_FIX)) {
851 uint32_t tmpui = gpsSol.groundSpeed * 1944 / 100;
853 *clearToSend =
false;
857 if (STATE(GPS_FIX)) {
862 if (tableInfo->
index & 1) {
863 tmpui = abs(gpsSol.llh.lon);
864 tmpui = (tmpui + tmpui / 2) / 25 | 0x80000000;
865 if (gpsSol.llh.lon < 0) tmpui |= 0x40000000;
868 tmpui = abs(gpsSol.llh.lat);
869 tmpui = (tmpui + tmpui / 2) / 25;
870 if (gpsSol.llh.lat < 0) tmpui |= 0x40000000;
873 *clearToSend =
false;
877 if (STATE(GPS_FIX)) {
879 *clearToSend =
false;
883 if (STATE(GPS_FIX)) {
885 *clearToSend =
false;
893 *clearToSend =
false;
900 *clearToSend =
false;