AP_HAL_SMACCM: guard compilation on CONFIG_HAL_BOARD

This commit is contained in:
Pat Hickey 2013-01-09 13:32:34 -08:00
parent 59365f1b90
commit 8f5da03f93
13 changed files with 76 additions and 1 deletions

View File

@ -1,3 +1,19 @@
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* AP_HAL_SMACCM_Main.cpp --- AP_HAL_SMACCM main task implementation.
*
* Copyright (C) 2012, Galois, Inc.
* All Rights Reserved.
*
* This software is released under the "BSD3" license. Read the file
* "LICENSE" for more information.
*
* Written by James Bielman <jamesjb@galois.com>, 20 December 2012
*/
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <AP_HAL_SMACCM.h>
#include <AP_HAL_SMACCM_Main.h>
@ -27,3 +43,5 @@ void SMACCM::hal_main()
for (;;)
;
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -1,5 +1,8 @@
#include <AP_HAL.h>
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include "HAL_SMACCM_Class.h"
#include "AP_HAL_SMACCM_Private.h"
@ -56,3 +59,4 @@ void HAL_SMACCM::init(int argc,char* const argv[]) const
const HAL_SMACCM AP_HAL_SMACCM;
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -11,6 +11,10 @@
* Written by James Bielman <jamesjb@galois.com>, 20 December 2012
*/
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <AP_HAL.h>
#include <hwf4/i2c.h>
#include <hwf4/gpio.h>
@ -88,3 +92,5 @@ uint8_t SMACCMI2CDriver::lockup_count()
{
return 0;
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -1,4 +1,8 @@
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include "RCInput.h"
#include <hwf4/timer.h>
@ -99,3 +103,5 @@ void SMACCMRCInput::clear_overrides()
for (int i = 0; i < PPM_MAX_CHANNELS; ++i)
_override[i] = 0;
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -3,7 +3,6 @@
#define __AP_HAL_SMACCM_RCINPUT_H__
#include <AP_HAL_SMACCM.h>
#include <hwf4/timer.h>
class SMACCM::SMACCMRCInput : public AP_HAL::RCInput {
public:

View File

@ -8,6 +8,10 @@
* "LICENSE" for more information.
*/
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include "SPIDriver.h"
#include <FreeRTOS.h>
#include <hwf4/spi.h>
@ -106,3 +110,5 @@ AP_HAL::SPIDeviceDriver* SMACCMSPIDeviceManager::device(AP_HAL::SPIDevice dev)
return NULL;
}
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -11,6 +11,10 @@
#ifndef __AP_HAL_SMACCM_SPIDRIVER_H__
#define __AP_HAL_SMACCM_SPIDRIVER_H__
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <AP_HAL_SMACCM.h>
#include "Semaphores.h"
@ -39,4 +43,5 @@ public:
AP_HAL::SPIDeviceDriver* device(AP_HAL::SPIDevice);
};
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#endif // __AP_HAL_SMACCM_SPIDRIVER_H__

View File

@ -11,6 +11,10 @@
* Written by James Bielman <jamesjb@galois.com>, 20 December 2012
*/
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <hwf4/gpio.h>
#include <hwf4/timer.h>
@ -275,3 +279,5 @@ void SMACCMScheduler::run_delay_cb()
if (m_delay_cb)
m_delay_cb();
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -1,6 +1,8 @@
#include "Semaphores.h"
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
using namespace SMACCM;
SMACCMSemaphore::SMACCMSemaphore()
@ -34,3 +36,5 @@ bool SMACCMSemaphore::give()
{
return xSemaphoreGive(m_semaphore);
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -2,6 +2,10 @@
#ifndef __AP_HAL_SMACCM_SEMAPHORE_H__
#define __AP_HAL_SMACCM_SEMAPHORE_H__
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <AP_HAL_SMACCM.h>
#include <FreeRTOS.h>
#include <semphr.h>
@ -19,4 +23,5 @@ private:
xSemaphoreHandle m_semaphore;
};
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#endif // __AP_HAL_SMACCM_SEMAPHORE_H__

View File

@ -11,6 +11,10 @@
* Written by James Bielman <jamesjb@galois.com>, 20 December 2012
*/
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <string.h>
#include <hwf4/eeprom.h>
@ -78,3 +82,5 @@ void SMACCMStorage::write_block(uint16_t loc, void* src, size_t n)
{
eeprom_write(loc, (const uint8_t *)src, n);
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -9,6 +9,9 @@
*/
#include "UARTDriver.h"
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <stdio.h> // for vsnprintf
using namespace SMACCM;
@ -165,3 +168,5 @@ size_t SMACCMUARTDriver::write(uint8_t c)
portTickType delay = m_blocking ? portMAX_DELAY : 0;
return usart_write_timeout(m_dev, delay, &c, 1);
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM

View File

@ -2,6 +2,10 @@
#ifndef __AP_HAL_SMACCM_UARTDRIVER_H__
#define __AP_HAL_SMACCM_UARTDRIVER_H__
#include <AP_HAL_Boards.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#include <AP_HAL_SMACCM.h>
#include <hwf4/usart.h>
@ -43,4 +47,5 @@ private:
bool m_blocking;
};
#endif // CONFIG_HAL_BOARD == HAL_BOARD_SMACCM
#endif // __AP_HAL_SMACCM_UARTDRIVER_H__