Skip to content

Commit

Permalink
Merge pull request pr3y#515 from bmorcelli/main
Browse files Browse the repository at this point in the history
RF RAW enhancements
  • Loading branch information
bmorcelli authored Dec 4, 2024
2 parents 8808835 + 48e4cbb commit 62c2d5e
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 192 deletions.
3 changes: 3 additions & 0 deletions ports/lilygo-t-embed-cc1101/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include <Arduino.h>
#include <vector>

#define RFID125_RX_PIN 44
#define RFID125_TX_PIN 43

//#define HAS_KEYBOARD //has keyboard to use
//#define HAS_KEYBOARD_HID //has keyboard to use
//#define KB_HID_EXIT_MSG "Mid Btn + Space to exit"
Expand Down
10 changes: 5 additions & 5 deletions ports/m5stack-cplus2/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ build_flags =
; connection pins for CC1101 https://github.com/bmorcelli/io433/blob/master/platformio.ini
-DUSE_CC1101_VIA_SPI
-DCC1101_GDO0_PIN=25
-DCC1101_SS_PIN=SPI_SS_PIN
-DCC1101_MOSI_PIN=SPI_MOSI_PIN
-DCC1101_SCK_PIN=SPI_SCK_PIN
-DCC1101_MISO_PIN=SPI_MISO_PIN
-DCC1101_SS_PIN=SPI_SS_PIN
-DCC1101_MOSI_PIN=SPI_MOSI_PIN
-DCC1101_SCK_PIN=SPI_SCK_PIN
-DCC1101_MISO_PIN=SPI_MISO_PIN
;-DCC1101_GDO2_PIN=-1

; connections are the same as CC1101
Expand Down Expand Up @@ -127,7 +127,7 @@ build_flags =
;SD Card Setup pins
-DSDCARD_CS=14
-DSDCARD_SCK=0
-DSDCARD_MISO=36
-DSDCARD_MISO=25
-DSDCARD_MOSI=26

;Default I2C port
Expand Down
11 changes: 7 additions & 4 deletions src/modules/NRF24/nrf_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ bool nrf_start() {

#if CC1101_MOSI_PIN==TFT_MOSI // (T_EMBED), CORE2 and others
NRFSPI = &tft.getSPIinstance();
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN,NRF24_SS_PIN);
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN);
#elif CC1101_MOSI_PIN==SDCARD_MOSI
NRFSPI = &sdcardSPI;
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN,NRF24_SS_PIN);
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN);
//#elif defined(STICK_C_PLUS) || defined(STICK_C_PLUS2)
// NRFSPI = &CC_NRF_SPI;
// NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN);
#else
NRFSPI = &SPI;
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN,NRF24_SS_PIN);
NRFSPI->begin(NRF24_SCK_PIN,NRF24_MISO_PIN,NRF24_MOSI_PIN);
#endif

if(NRFradio.begin(NRFSPI))
if(NRFradio.begin(NRFSPI,rf24_gpio_pin_t(NRF24_CE_PIN),rf24_gpio_pin_t(NRF24_SS_PIN)))
{
return true;
}
Expand Down
12 changes: 8 additions & 4 deletions src/modules/ble/ble_spam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ void executeSpam(EBLEPayloadType type) {
}
BLEDevice::init("");
delay(10);
esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, MAX_TX_POWER);
pAdvertising = BLEDevice::getAdvertising();
delay(40);
BLEAdvertisementData advertisementData = GetUniversalAdvertisementData(type);
Expand All @@ -441,9 +442,6 @@ void executeSpam(EBLEPayloadType type) {
}

void aj_adv(int ble_choice){

esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, MAX_TX_POWER);

int mael = 0;
int timer = 0;
int count = 0;
Expand Down Expand Up @@ -488,5 +486,11 @@ void aj_adv(int ble_choice){
break;
}
}
if(ble_choice>0) BLEDevice::deinit();

BLEDevice::init("");
delay(100);
pAdvertising = nullptr;
delay(100);
BLEDevice::deinit();

}
Loading

0 comments on commit 62c2d5e

Please sign in to comment.