Skip to content

Commit

Permalink
Merge pull request #128 from ArielHeleneto/main
Browse files Browse the repository at this point in the history
Compress Freqs.
  • Loading branch information
losehu authored Jun 26, 2024
2 parents 34558a4 + 5f8d2fe commit 9c42a66
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
53 changes: 28 additions & 25 deletions frequencies.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,42 +182,45 @@ int32_t TX_freq_check(const uint32_t Frequency)
break;

case F_LOCK_FCC:
if (Frequency >= 14400000 && Frequency < 14800000)
if (Frequency >= 14400000 && Frequency <= 14800000)
return 0;
if (Frequency >= 42000000 && Frequency < 45000000)
if (Frequency >= 42000000 && Frequency <= 45000000)
return 0;
break;

case F_LOCK_CE:
if (Frequency >= 14400000 && Frequency < 14600000)
return 0;
if (Frequency >= 43000000 && Frequency < 44000000)
return 0;
break;
// case F_LOCK_CE:
// if (Frequency >= 14400000 && Frequency <= 14800000)
// return 0;
// if (Frequency >= 43000000 && Frequency <= 44000000)
// return 0;
// break;

case F_LOCK_GB:
if (Frequency >= 14400000 && Frequency < 14800000)
if (Frequency >= 14400000 && Frequency <= 14800000)
return 0;
if (Frequency >= 43000000 && Frequency < 44000000)
if (Frequency >= 43000000 && Frequency <= 44000000)
return 0;
for (uint32_t i = 40975000; i <= 40998750; i+=1250)
if (Frequency == i)
return 0;
break;

case F_LOCK_430:
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
return 0;
if (Frequency >= 40000000 && Frequency < 43000000)
return 0;
break;
// case F_LOCK_430:
// if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
// return 0;
// if (Frequency >= 40000000 && Frequency < 43000000)
// return 0;
// break;

case F_LOCK_438:
if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
return 0;
if (Frequency >= 40000000 && Frequency < 43800000)
return 0;
break;
// case F_LOCK_438:
// if (Frequency >= frequencyBandTable[BAND3_137MHz].lower && Frequency < 17400000)
// return 0;
// if (Frequency >= 40000000 && Frequency < 43800000)
// return 0;
// break;

case F_LOCK_ALL:
break;
// case F_LOCK_ALL:
// break;

case F_LOCK_NONE:
for (uint32_t i = 0; i < ARRAY_SIZE(frequencyBandTable); i++)
Expand All @@ -241,4 +244,4 @@ int32_t RX_freq_check(const uint32_t Frequency)
return -1;

return 0; // OK frequency
}
}
5 changes: 2 additions & 3 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ typedef enum POWER_OnDisplayMode_t POWER_OnDisplayMode_t;
enum TxLockModes_t {
F_LOCK_DEF, //all default frequencies + configurable
F_LOCK_FCC,
F_LOCK_CE,
F_LOCK_GB,
F_LOCK_430,
F_LOCK_438,
// F_LOCK_430,
// F_LOCK_438,
F_LOCK_ALL, // disable TX on all frequencies
F_LOCK_NONE, // enable TX on all frequencies
F_LOCK_LEN
Expand Down
9 changes: 3 additions & 6 deletions ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,9 @@ const char gSubMenu_RESET[][6] =//4

const char *const gSubMenu_F_LOCK[] =
{
"DEFAULT+\n137-174\n400-470",
"FCC HAM\n144-148\n420-450",
"CE HAM\n144-146\n430-440",
"GB HAM\n144-148\n430-440",
"137-174\n400-430",
"137-174\n400-438",
"DEFAULT\n137-174\n400-470",
"FCC HAM+Pub\n144-148\n420-450",
"GB HAM+Pub\n144-148\n430-440,409",
// "DISABLE\nALL",
// "UNLOCK\nALL",
禁用全部,
Expand Down

0 comments on commit 9c42a66

Please sign in to comment.