Skip to content

Commit

Permalink
Merge pull request #5 from bitcraze/ataffanel/legacy_cont_wave
Browse files Browse the repository at this point in the history
Implement continious wave in legacy USB mode
  • Loading branch information
ataffanel authored Nov 22, 2024
2 parents 068fb1b + 3b337f4 commit 5f1643e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/legacy_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#include "led.h"
#include "system.h"

#include <hal/nrf_radio.h>

#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usb);

Expand Down Expand Up @@ -187,6 +189,16 @@ static int crazyradio_vendor_handler(struct usb_setup_packet *setup,
esb_set_ack_enabled(enabled);
} else if (setup->bRequest == SET_CONT_CARRIER && setup->wLength == 0) {
LOG_DBG("Setting radio Continious carrier %s", setup->wValue?"true":"false");

if (setup->wValue) {
fem_txen_set(true);

nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_TXEN);
} else {
nrf_radio_task_trigger(NRF_RADIO, NRF_RADIO_TASK_DISABLE);

fem_txen_set(false);
}
} else if (setup->bRequest == CHANNEL_SCANN && usb_reqtype_is_to_device(setup)) {
uint8_t start = setup->wValue;
uint8_t stop = setup->wIndex;
Expand Down

0 comments on commit 5f1643e

Please sign in to comment.