updated protoview & usb_hid_autofire

This commit is contained in:
jbohack
2023-01-09 15:34:18 -05:00
parent b1d605aa69
commit 4992c89630
26 changed files with 1324 additions and 349 deletions

View File

@@ -2,17 +2,20 @@
* See the LICENSE file for information about the license. */
#include "app.h"
#include "custom_presets.h"
#include <flipper_format/flipper_format_i.h>
ProtoViewModulation ProtoViewModulations[] = {
{"OOK 650Khz", FuriHalSubGhzPresetOok650Async},
{"OOK 270Khz", FuriHalSubGhzPresetOok270Async},
{"2FSK 2.38Khz", FuriHalSubGhzPreset2FSKDev238Async},
{"2FSK 47.6Khz", FuriHalSubGhzPreset2FSKDev476Async},
{"MSK", FuriHalSubGhzPresetMSK99_97KbAsync},
{"GFSK", FuriHalSubGhzPresetGFSK9_99KbAsync},
{NULL, 0} /* End of list sentinel. */
{"OOK 650Khz", FuriHalSubGhzPresetOok650Async, NULL},
{"OOK 270Khz", FuriHalSubGhzPresetOok270Async, NULL},
{"2FSK 2.38Khz", FuriHalSubGhzPreset2FSKDev238Async, NULL},
{"2FSK 47.6Khz", FuriHalSubGhzPreset2FSKDev476Async, NULL},
{"MSK", FuriHalSubGhzPresetMSK99_97KbAsync, NULL},
{"GFSK", FuriHalSubGhzPresetGFSK9_99KbAsync, NULL},
{"TPMS 1 (FSK)", 0, (uint8_t*)protoview_subghz_tpms1_async_regs},
{"TPMS 2 (FSK)", 0, (uint8_t*)protoview_subghz_tpms2_async_regs},
{NULL, 0, NULL} /* End of list sentinel. */
};
/* Called after the application initialization in order to setup the
@@ -23,7 +26,14 @@ void radio_begin(ProtoViewApp* app) {
furi_assert(app);
furi_hal_subghz_reset();
furi_hal_subghz_idle();
furi_hal_subghz_load_preset(ProtoViewModulations[app->modulation].preset);
/* The CC1101 preset can be either one of the standard presets, if
* the modulation "custom" field is NULL, or a custom preset we
* defined in custom_presets.h. */
if (ProtoViewModulations[app->modulation].custom == NULL)
furi_hal_subghz_load_preset(ProtoViewModulations[app->modulation].preset);
else
furi_hal_subghz_load_custom_preset(ProtoViewModulations[app->modulation].custom);
furi_hal_gpio_init(&gpio_cc1101_g0, GpioModeInput, GpioPullNo, GpioSpeedLow);
app->txrx->txrx_state = TxRxStateIDLE;
}