MCPcopy Create free account
hub / github.com/BruceDevices/firmware / setMHZMenu

Function setMHZMenu

src/modules/rf/rf_utils.cpp:514–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514bool setMHZMenu() {
515 if (bruceConfigPins.rfModule != CC1101_SPI_MODULE) return false;
516 if (check(SelPress)) {
517 options = {};
518 int ind = 0;
519 int arraySize = sizeof(subghz_frequency_list) / sizeof(subghz_frequency_list[0]);
520 for (int i = 0; i < arraySize; i++) {
521 if (subghz_frequency_list[i] - bruceConfigPins.rfFreq < 0.1) ind = i;
522 String tmp = String(subghz_frequency_list[i], 2) + "Mhz";
523 options.push_back({tmp.c_str(), [=]() { bruceConfigPins.rfFreq = subghz_frequency_list[i]; }});
524 }
525 loopOptions(options, ind);
526 options.clear();
527 setMHZ(bruceConfigPins.rfFreq);
528 return true;
529 }
530 return false;
531}
532
533void rf_range_selection(float currentFrequency) {
534 int option = 0;

Callers 2

rf_spectrumFunction · 0.85
rf_SquareWaveFunction · 0.85

Calls 4

checkFunction · 0.85
setMHZFunction · 0.85
loopOptionsFunction · 0.50
clearMethod · 0.45

Tested by 2

rf_spectrumFunction · 0.68
rf_SquareWaveFunction · 0.68