Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
WIP

WIP
  • Loading branch information
Pradeep-Carbonix committed May 24, 2024
1 parent 344d84e commit a4aa7bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
9 changes: 7 additions & 2 deletions Tools/AP_Periph/can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,11 @@ void AP_Periph_FW::esc_telem_update()
pkt.power_rating_pct = 0;
pkt.error_count = 0;

/* temporary fix, until a fix for index-15 issue is identified */
if (pkt.voltage == nan || pkt.current == nan || pkt.temperature == nan || pkt.rpm == nan) {
continue;
}

uint8_t buffer[UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE] {};
uint16_t total_size = uavcan_equipment_esc_Status_encode(&pkt, buffer, !periph.canfdout());
canard_broadcast(UAVCAN_EQUIPMENT_ESC_STATUS_SIGNATURE,
Expand All @@ -1664,8 +1669,8 @@ void AP_Periph_FW::esc_telem_update()
uavcan_equipment_esc_StatusExtended pkt2{};
pkt2.esc_index = pkt.esc_index;
bool has_ext_data = esc_telem.get_input_duty(i, pkt2.input_pct)
|| esc_telem.get_output_duty(i, pkt2.output_pct)
|| esc_telem.get_flags(i, pkt2.status_flags);
| esc_telem.get_output_duty(i, pkt2.output_pct)
| esc_telem.get_flags(i, pkt2.status_flags);

if (has_ext_data) {
uint8_t buffer_ext[UAVCAN_EQUIPMENT_ESC_STATUSEXTENDED_MAX_SIZE] {};
Expand Down
4 changes: 3 additions & 1 deletion libraries/AP_BLHeli/AP_BLHeli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ const AP_Param::GroupInfo AP_BLHeli::var_info[] = {
// @RebootRequired: True
AP_GROUPINFO("RVMASK", 12, AP_BLHeli, channel_reversed_mask, 0),

#if HAL_WITH_ESC_TELEM
// @Param: EXT_TLM
// @DisplayName: Enable extended BLHeli telemetry
// @Description: When set to 1, this listens for 13-byte extended telemetry packets from BLHeli ESCs
// @Values: 0:Disabled,1:Enabled
// @User: Advanced
AP_GROUPINFO("EXT_TLM", 13, AP_BLHeli, extended_telemetry, 0),
AP_GROUPINFO("EXTLM", 13, AP_BLHeli, extended_telemetry, 0),
#endif

AP_GROUPEND
};
Expand Down
9 changes: 0 additions & 9 deletions libraries/AP_ESC_Telem/AP_ESC_Telem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ const AP_Param::GroupInfo AP_ESC_Telem::var_info[] = {
// @Range: 0 31
// @User: Standard
AP_GROUPINFO("_MAV_OFS", 1, AP_ESC_Telem, mavlink_offset, 0),

// @Param: _EXT_TELEM
// @DisplayName: Extended ESC Telemetry
// @Description: This enables extended telemetry for ESCs that support it.
// @Values: 0:None,1:Enable extended telemetry
// @Range: 0 1
// @User: Standard
// @RebootRequired: False
AP_GROUPINFO("_EXTEND", 2, AP_ESC_Telem, ext_esc_telem, 0),

AP_GROUPEND
};
Expand Down
1 change: 0 additions & 1 deletion libraries/AP_ESC_Telem/AP_ESC_Telem.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class AP_ESC_Telem {
bool _have_data;

AP_Int8 mavlink_offset;
AP_Int8 ext_esc_telem;

static AP_ESC_Telem *_singleton;
};
Expand Down

0 comments on commit a4aa7bb

Please sign in to comment.