Skip to content

Commit

Permalink
400hz changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jschall committed Feb 16, 2015
1 parent e2c6c30 commit 2459320
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions ArduCopter/ArduCopter.pde
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,10 @@ static void fast_loop()

// run the attitude controllers
update_flight_mode();

if (should_log(MASK_LOG_IMU)) {
DataFlash.Log_Write_IMU(ins);
}
}

// rc_loops - reads user input from transmitter/receiver
Expand Down Expand Up @@ -1093,10 +1097,6 @@ static void fifty_hz_logging_loop()
if (should_log(MASK_LOG_ATTITUDE_FAST)) {
Log_Write_Attitude();
}

if (should_log(MASK_LOG_IMU)) {
DataFlash.Log_Write_IMU(ins);
}
#endif
if (should_log(MASK_LOG_ANY)) {
Log_Write_Data(DATA_AP_STATE, ap.value);
Expand Down
2 changes: 2 additions & 0 deletions ArduCopter/system.pde
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ static void init_ardupilot()
// identify ourselves correctly with the ground station
mavlink_system.sysid = g.sysid_this_mav;

g.log_bitmask = MASK_LOG_IMU;

#if LOGGING_ENABLED == ENABLED
DataFlash.Init(log_structure, sizeof(log_structure)/sizeof(log_structure[0]));
if (!DataFlash.CardInserted()) {
Expand Down
9 changes: 5 additions & 4 deletions libraries/AP_Terrain/AP_Terrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#include <AP_HAL.h>
#include <DataFlash.h>

#if HAL_OS_POSIX_IO && defined(HAL_BOARD_TERRAIN_DIRECTORY)
#define AP_TERRAIN_AVAILABLE 1
#else
#define AP_TERRAIN_AVAILABLE 0
#endif
// #if HAL_OS_POSIX_IO && defined(HAL_BOARD_TERRAIN_DIRECTORY)
// #define AP_TERRAIN_AVAILABLE 1
// #else
// #define AP_TERRAIN_AVAILABLE 0
// #endif

#if AP_TERRAIN_AVAILABLE

Expand Down
2 changes: 1 addition & 1 deletion libraries/DataFlash/DataFlash_File.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ DataFlash_File::DataFlash_File(const char *log_directory) :
_open_error(false),
_log_directory(log_directory),
_writebuf(NULL),
_writebuf_size(16*1024),
_writebuf_size(48*1024),
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V1)
// V1 gets IO errors with larger than 512 byte writes
_writebuf_chunk(512),
Expand Down

0 comments on commit 2459320

Please sign in to comment.