Copter: don't log events with LOG_BITMASK==0

This commit is contained in:
Andrew Tridgell 2013-01-11 16:32:23 +11:00
parent 8657071919
commit 4a9e3a068a
1 changed files with 5 additions and 0 deletions

View File

@ -892,6 +892,7 @@ static void Log_Read_Startup()
static void Log_Write_Data(uint8_t _index, int32_t _data)
{
if (g.log_bitmask == 0) return;
DataFlash.WriteByte(HEAD_BYTE1);
DataFlash.WriteByte(HEAD_BYTE2);
DataFlash.WriteByte(LOG_DATA_MSG);
@ -903,6 +904,7 @@ static void Log_Write_Data(uint8_t _index, int32_t _data)
static void Log_Write_Data(uint8_t _index, float _data)
{
if (g.log_bitmask == 0) return;
DataFlash.WriteByte(HEAD_BYTE1);
DataFlash.WriteByte(HEAD_BYTE2);
DataFlash.WriteByte(LOG_DATA_MSG);
@ -914,6 +916,7 @@ static void Log_Write_Data(uint8_t _index, float _data)
static void Log_Write_Data(uint8_t _index, int16_t _data)
{
if (g.log_bitmask == 0) return;
DataFlash.WriteByte(HEAD_BYTE1);
DataFlash.WriteByte(HEAD_BYTE2);
DataFlash.WriteByte(LOG_DATA_MSG);
@ -925,6 +928,7 @@ static void Log_Write_Data(uint8_t _index, int16_t _data)
static void Log_Write_Data(uint8_t _index, uint16_t _data)
{
if (g.log_bitmask == 0) return;
DataFlash.WriteByte(HEAD_BYTE1);
DataFlash.WriteByte(HEAD_BYTE2);
DataFlash.WriteByte(LOG_DATA_MSG);
@ -937,6 +941,7 @@ static void Log_Write_Data(uint8_t _index, uint16_t _data)
static void Log_Write_Event(uint8_t _index)
{
if (g.log_bitmask == 0) return;
DataFlash.WriteByte(HEAD_BYTE1);
DataFlash.WriteByte(HEAD_BYTE2);
DataFlash.WriteByte(LOG_DATA_MSG);