Skip to content

Commit

Permalink
Merge pull request #70 from fagci/main
Browse files Browse the repository at this point in the history
feat: 32KHz to track satellite doppler shift, better smaller steps, better sensitivity, better defaults, green led on rx only, use more fw functions, more precise numbers for freq&step
  • Loading branch information
piotr022 authored Aug 14, 2023
2 parents aebb19b + d050bdc commit 9150e39
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 124 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Features:

* no scan sound
* squelch by user input level
* 0.2 .. 3.2MHz frequency ranges
* 0.1 .. 3.2MHz frequency ranges
* ticks by frequency (100,500,1000KHz)
* catch signal peak frequency
* automatic frequency change step
Expand All @@ -41,8 +41,11 @@ How to start:

How to operate:

* press **8** / **2** for zoom in / zoom out
* press and hold **3** / **9** to set squelch level
* press **UP** / **DOWN** key to change frequency
* press **1** / **7** to control measurement time (increasing "sensitivity")
* press **2** / **8** to to set frequency change step
* press **9** / **3** for zoom in / zoom out
* press and hold **\*** / **F** to set squelch level
* press **5** to toggle backlight
* press **0** to remove frequency from sspectrum to scan
* press **EXIT** to disable spectrum view
Expand Down
6 changes: 6 additions & 0 deletions libs/k5_uv_system/api.s
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ BK4819Reset = 0xa7cc + 1;
.globl IntDivide
IntDivide = 0x128 + 1;

.globl Strlen
Strlen = 0x1c0 + 1;

.globl BK4819SetChannelBandwidth
BK4819SetChannelBandwidth = 0xaa48 + 1;

.globl BK4819WriteFrequency
BK4819WriteFrequency = 0xaabc + 1;

Expand Down
2 changes: 2 additions & 0 deletions libs/k5_uv_system/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ extern "C" {
void AirCopyFskSetup();
void BK4819Reset();
int IntDivide(int s32Divident, int s32Divisor);
int Strlen(const char *string);
void BK4819SetChannelBandwidth(bool narrow);
void BK4819WriteFrequency(unsigned int u32Frequency);
void BK4819SetPaGain(unsigned short u16PaBias, unsigned int u32Frequency);
void BK4819ConfigureAndStartTxFsk();
Expand Down
18 changes: 6 additions & 12 deletions libs/lcd/lcd.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <string.h>
#include <type_traits>
#include "system.hpp"

struct ILcd {
virtual void UpdateScreen() = 0;
Expand Down Expand Up @@ -161,7 +162,7 @@ template <class BitmapType> class CDisplay {
}

void Print(const char *C8String) const {
for (unsigned char i = 0; i < strlen(C8String); i++) {
for (unsigned char i = 0; i < Strlen(C8String); i++) {
PrintCharacter(C8String[i]);
}
}
Expand Down Expand Up @@ -256,24 +257,17 @@ template <class BitmapType> class CDisplay {
startIdx = 8 - i;
}

// If the number was 0, we write a single 0.
/* if (startIdx == 0)
U8NumBuff[0] = '0'; */

// Print the string from the start index
if (u8FixedDigtsCnt) {
startIdx = 9 - u8DigsToCut - u8FixedDigtsCnt;
}
startIdx = 9 - u8DigsToCut - u8FixedDigtsCnt;

const char *str = U8NumBuff + startIdx;
const char len = strlen(str);
const char len = Strlen(str);
const char dot[1] = {64};
for (unsigned char i = 0; i < len; i++) {
if (pointAt == len - i) {
u16CoursorPosition++;
auto *pCoursorPosition = Bitmap.GetCoursorData(u16CoursorPosition);
auto *pCoursorPosition = Bitmap.GetCoursorData(u16CoursorPosition + 1);
memcpy(pCoursorPosition, dot, 1);
u16CoursorPosition++;
u16CoursorPosition += 2;
}
PrintCharacter(str[i]);
}
Expand Down
26 changes: 26 additions & 0 deletions src/spectrum_fagci/keys.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
enum Keys {
NUM0,
NUM1,
NUM2,
NUM3,
NUM4,
NUM5,
NUM6,
NUM7,
NUM8,
NUM9,
MENU, // 10
UP, // 11
DOWN, // 12
EXIT, // 13
ASTERISK, // 14
FUNCTION, // 15
_NA16,
_NA17,
_NA18,
_NA19,
_NA20,
_NA21,
FN2, // 22
FN1, // 23
};
Loading

0 comments on commit 9150e39

Please sign in to comment.