mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
Renamed / cleaned up the CC2500 driver.
This commit is contained in:
parent
bf3dd1991d
commit
0a1290685f
8 changed files with 43 additions and 7 deletions
|
@ -1,3 +1,20 @@
|
|||
/*
|
||||
* This file is part of Cleanflight.
|
||||
*
|
||||
* Cleanflight is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Cleanflight is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* CC2500 SPI drivers
|
||||
*/
|
||||
|
@ -7,14 +24,16 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef USE_RX_CC2500
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#include "drivers/cc2500.h"
|
||||
#include "drivers/io.h"
|
||||
#include "drivers/rx_spi.h"
|
||||
#include "drivers/system.h"
|
||||
#include "drivers/time.h"
|
||||
|
||||
#include "rx_cc2500.h"
|
||||
|
||||
#define NOP 0xFF
|
||||
|
||||
|
@ -82,3 +101,4 @@ uint8_t cc2500Reset(void)
|
|||
// TX_EN_off;//off rx
|
||||
return cc2500ReadReg(CC2500_0E_FREQ1) == 0xC4; // check if reset
|
||||
}
|
||||
#endif
|
|
@ -1,3 +1,19 @@
|
|||
/*
|
||||
* This file is part of Cleanflight.
|
||||
*
|
||||
* Cleanflight is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Cleanflight is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
CC2500 SPI drivers
|
|
@ -31,7 +31,7 @@
|
|||
#include "common/utils.h"
|
||||
|
||||
#include "drivers/adc.h"
|
||||
#include "drivers/cc2500.h"
|
||||
#include "drivers/rx_cc2500.h"
|
||||
#include "drivers/io.h"
|
||||
#include "drivers/system.h"
|
||||
#include "drivers/time.h"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "common/maths.h"
|
||||
|
||||
#include "drivers/cc2500.h"
|
||||
#include "drivers/rx_cc2500.h"
|
||||
#include "drivers/io.h"
|
||||
#include "drivers/time.h"
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "common/utils.h"
|
||||
|
||||
#include "drivers/adc.h"
|
||||
#include "drivers/cc2500.h"
|
||||
#include "drivers/rx_cc2500.h"
|
||||
#include "drivers/io.h"
|
||||
#include "drivers/io_def.h"
|
||||
#include "drivers/io_types.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "config/feature.h"
|
||||
|
||||
#include "drivers/cc2500.h"
|
||||
#include "drivers/rx_spi.h"
|
||||
#include "drivers/rx_nrf24l01.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
|
@ -59,7 +59,6 @@ static protocolSetRcDataFromPayloadFnPtr protocolSetRcDataFromPayload;
|
|||
|
||||
STATIC_UNIT_TESTED uint16_t rxSpiReadRawRC(const rxRuntimeConfig_t *rxRuntimeConfig, uint8_t channel)
|
||||
{
|
||||
|
||||
BUILD_BUG_ON(NRF24L01_MAX_PAYLOAD_SIZE > RX_SPI_MAX_PAYLOAD_SIZE);
|
||||
|
||||
if (channel >= rxRuntimeConfig->channelCount) {
|
||||
|
|
|
@ -5,7 +5,7 @@ FEATURES = VCP SDCARD
|
|||
TARGET_SRC = \
|
||||
drivers/accgyro/accgyro_mpu.c \
|
||||
drivers/accgyro/accgyro_mpu6050.c \
|
||||
drivers/cc2500.c \
|
||||
drivers/rx_cc2500.c \
|
||||
rx/cc2500_frsky_shared.c \
|
||||
rx/cc2500_frsky_d.c \
|
||||
rx/cc2500_frsky_x.c
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
#endif
|
||||
|
||||
#if defined(USE_RX_FRSKY_SPI_D) || defined(USE_RX_FRSKY_SPI_X)
|
||||
#define USE_RX_CC2500
|
||||
#define USE_RX_FRSKY_SPI
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue