mirror of
https://github.com/huuck/FlipperZeroNRFJammer.git
synced 2026-04-23 20:59:58 -07:00
Fixed a bug
Fixed a bug that could cause the jammer to not work on all channels or not work at all
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Types of Firmware:
|
||||
|firmware |file name |
|
||||
|------------|---------------------|
|
||||
|Momentum |nrf24_jammer[M].fap |
|
||||
|Unleashed |nrf24_jammer[U].fap |
|
||||
|RogueMaster |nrf24_jammer[R].fap |
|
||||
|Official |nrf24_jammer[OF].fap |
|
||||
|Momentum |nrf24_jammer_M.fap |
|
||||
|Unleashed |nrf24_jammer_U.fap |
|
||||
|RogueMaster |nrf24_jammer_R.fap |
|
||||
|Official |nrf24_jammer_OF.fap |
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
compiled/nrf24_jammer_M.fap
Normal file
BIN
compiled/nrf24_jammer_M.fap
Normal file
Binary file not shown.
BIN
compiled/nrf24_jammer_OF.fap
Normal file
BIN
compiled/nrf24_jammer_OF.fap
Normal file
Binary file not shown.
BIN
compiled/nrf24_jammer_R.fap
Normal file
BIN
compiled/nrf24_jammer_R.fap
Normal file
Binary file not shown.
BIN
compiled/nrf24_jammer_U.fap
Normal file
BIN
compiled/nrf24_jammer_U.fap
Normal file
Binary file not shown.
12
jammer.c
12
jammer.c
@@ -208,12 +208,18 @@ static int32_t mj_worker_thread(void* ctx) {
|
||||
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
|
||||
notification_message(notification, &sequence_blink_red_100);
|
||||
|
||||
nrf24_set_tx_mode(nrf24_HANDLE);
|
||||
|
||||
if(plugin_state->jam_type != 3) nrf24_startConstCarrier(nrf24_HANDLE, 3, hopping_channels[0]);
|
||||
|
||||
if(plugin_state->jam_type != 3) {
|
||||
nrf24_deinit();
|
||||
nrf24_init();
|
||||
nrf24_set_tx_mode(nrf24_HANDLE);
|
||||
nrf24_startConstCarrier(nrf24_HANDLE, 3, 45);
|
||||
}
|
||||
|
||||
uint8_t current_channel = 0;
|
||||
uint8_t limit = hopping_channels_len[plugin_state->jam_type];
|
||||
|
||||
nrf24_set_tx_mode(nrf24_HANDLE);
|
||||
|
||||
while(!plugin_state->close_thread_please) {
|
||||
for(int ch = 0; ch < limit && !plugin_state->close_thread_please; ch++) {
|
||||
|
||||
@@ -134,7 +134,10 @@ uint8_t nrf24_set_rate(FuriHalSpiBusHandle* handle, uint32_t rate) {
|
||||
}
|
||||
|
||||
void nrf24_startConstCarrier(FuriHalSpiBusHandle* handle, uint8_t level, uint8_t channel) {
|
||||
nrf24_set_idle(handle);
|
||||
nrf24_deinit();
|
||||
nrf24_init();
|
||||
|
||||
nrf24_set_tx_mode(handle);
|
||||
|
||||
nrf24_write_reg(handle, REG_RF_CH, channel);
|
||||
|
||||
@@ -165,8 +168,6 @@ void nrf24_startConstCarrier(FuriHalSpiBusHandle* handle, uint8_t level, uint8_t
|
||||
}
|
||||
|
||||
void nrf24_stopConstCarrier(FuriHalSpiBusHandle* handle) {
|
||||
nrf24_set_idle(handle);
|
||||
|
||||
uint8_t setup;
|
||||
nrf24_read_reg(handle, REG_RF_SETUP, &setup, 1);
|
||||
setup &= ~(NRF24_CONT_WAVE | NRF24_PLL_LOCK);
|
||||
|
||||
Reference in New Issue
Block a user