Skip to content

Commit

Permalink
AP_MSP: prepare for test version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
yaapu committed Jun 30, 2020
1 parent 74c0427 commit ab5cf8a
Show file tree
Hide file tree
Showing 48 changed files with 3,670 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ segv_*out
/ArduSub/scripts/
persistent.dat
dumpstack_*out
nbproject/
libraries/AP_Scripting/generator/gen-bindings

1 change: 1 addition & 0 deletions ArduCopter/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def build(bld):
'AP_OSD',
'AC_AutoTune',
'AP_KDECAN',
'AP_MSP',
],
)

Expand Down
1 change: 1 addition & 0 deletions ArduPlane/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def build(bld):
'AP_OSD',
'AC_AutoTune',
'AP_KDECAN',
'AP_MSP',
],
)

Expand Down
1 change: 1 addition & 0 deletions Tools/CodeStyle/astylerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ min-conditional-indent=0
suffix=none
lineend=linux
pad-header
indent-switches

9 changes: 7 additions & 2 deletions libraries/AP_BLHeli/AP_BLHeli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ void AP_BLHeli::msp_process_command(void)
break;
}

case MSP_SET_4WAY_IF: {
debug("MSP_SET_4WAY_IF");
case MSP_SET_PASSTHROUGH: {
debug("MSP_SET_PASSTHROUGH");
if (msp.dataSize == 0) {
msp.escMode = PROTOCOL_4WAY;
} else if (msp.dataSize == 2) {
Expand Down Expand Up @@ -1316,6 +1316,11 @@ void AP_BLHeli::update(void)

}

uint8_t AP_BLHeli::get_num_motors(void)
{
return num_motors;
}

// get the most recent telemetry data packet for a motor
bool AP_BLHeli::get_telem_data(uint8_t esc_index, struct telem_data &td)
{
Expand Down
4 changes: 3 additions & 1 deletion libraries/AP_BLHeli/AP_BLHeli.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <AP_Param/AP_Param.h>
#include <Filter/LowPassFilter.h>
#include "msp_protocol.h"
#include <AP_MSP/msp_protocol.h>
#include "blheli_4way_protocol.h"

#define AP_BLHELI_MAX_ESCS 8
Expand All @@ -56,6 +56,8 @@ class AP_BLHeli {
uint32_t timestamp_ms;
};

// how many motors do we have?
uint8_t get_num_motors(void);
// get the most recent telemetry data packet for a motor
bool get_telem_data(uint8_t esc_index, struct telem_data &td);
// return the average motor frequency in Hz for dynamic filtering
Expand Down
2 changes: 2 additions & 0 deletions libraries/AP_Common/AP_Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
bool. Bitnumber starts at 0 for the first bit
*/
#define BIT_IS_SET(value, bitnumber) (((value) & (1U<<(bitnumber))) != 0)
#define BIT_SET(value, bitnumber) ((value) |= (((typeof(value))1U) << (bitnumber)))
#define BIT_CLEAR(value, bitnumber) ((value) &= ~(((typeof(value))1U) << (bitnumber)))

// get high or low bytes from 2 byte integer
#define LOWBYTE(i) ((uint8_t)(i))
Expand Down
1 change: 1 addition & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,6 @@ define BOARD_PWM_COUNT_DEFAULT 6
define STM32_PWM_USE_ADVANCED TRUE

# we are low on flash on this board
define HAL_MSP_ENABLED 1
define HAL_MINIMIZE_FEATURES 1
define HAL_WITH_DSP 1
1 change: 1 addition & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
include ../Pixhawk1/hwdef.dat

FLASH_SIZE_KB 1024
define HAL_MSP_ENABLED 1
define HAL_MINIMIZE_FEATURES 1
undef STORAGE_FLASH_PAGE
Loading

0 comments on commit ab5cf8a

Please sign in to comment.