spectrum-readme-upd

pull/16/head release-23
Piotr Lewandowski 2023-07-08 12:23:49 +02:00
rodzic 9ddf45ecce
commit a6ff2fbda4
5 zmienionych plików z 23 dodań i 39 usunięć

Wyświetl plik

@ -1,8 +1,8 @@
# UV_K5_playground
## src/spectrum ![auto release build](https://github.com/piotr022/UV_K5_playground/actions/workflows/c-cpp.yml/badge.svg)
![rssi printer](./docs/spectrum2.png)
**new version**
Spectrum scanner. It prints a spectrum graph. Zoom in and zoom out as well as resolution could be controled via keyboard.
![rssi printer](./docs/spectrum.gif)
**update**
Spectrum scanner. It prints a spectrum graph. Zoom in well as resolution can be controled via keyboard.
* download mod [uv_k5_01_26_spectrum_2MHz_encoded.bin](https://github.com/piotr022/UV_K5_playground/releases/latest)
* to enable spectum view press **flash light button**

BIN
docs/spectrum.gif 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 8.2 MiB

Wyświetl plik

@ -41,13 +41,7 @@ namespace System
unsigned int u32StopPixel,
unsigned int u32LineNumber,
unsigned int u32PxPerChar,
unsigned int u32Centered,
unsigned int u32MenuLen,
unsigned int u32AsciiIdx,
unsigned int u32Unknown0,
unsigned int u32Unknown1,
unsigned int u32Unknown2,
unsigned int u32Unknown3
unsigned int u32Centered
);
void(*FillScreenMemory)(unsigned int u32Param1);
@ -59,6 +53,9 @@ namespace System
void(*FlushFramebufferToScreen)(void);
unsigned int(*PollKeyboard)(void);
char* (*sprintf)(char *, const char *, ...);
void(*FillWithZero)(unsigned char* p8Data, unsigned int u32Size);
char* (*FormatString)(char *, const char *, ...);
};
struct TOrgData
@ -81,6 +78,8 @@ namespace System
.FlushFramebufferToScreen = (decltype(TOrgFunctions::FlushFramebufferToScreen) (0xB638 + 1)),
.PollKeyboard = (decltype(TOrgFunctions::PollKeyboard) (0xb0b8 + 1)),
.sprintf = (decltype(TOrgFunctions::sprintf) (0xc8ec + 1)),
.FillWithZero = (decltype(TOrgFunctions::FillWithZero) (0x1AA + 1)),
.FormatString = (decltype(TOrgFunctions::FormatString) (0xC6E8 + 1)),
};
inline const TOrgData OrgData_01_26 =

Wyświetl plik

@ -15,37 +15,22 @@ public:
void Handle()
{
DisplayBuff.ClearAll();
char C8RssiString[] = "g000";
unsigned int u32Key = Fw.PollKeyboard();
C8RssiString[1] = '0' + (u32Key / 100 )% 10;
C8RssiString[2] = '0' + (u32Key / 10) % 10;
C8RssiString[3] = '0' + u32Key % 10;
switch(u32Key)
if (!(GPIOC->DATA & 0b1))
{
case 2:
y -= 3;
break;
case 8:
y += 3;
break;
case 4:
x -= 3;
break;
case 6:
x += 3;
break;
default:
break;
return;
}
Display.DrawCircle(x, y, 5, true);
Display.SetCoursor(3, 0);
Display.SetFont(&FontSmallNr);
Display.Print(C8RssiString);
if (!(Fw.BK4819Read(0x0C) & 0b10))
{
return;
}
char kupa[20];
Fw.FormatString(kupa, "test %u", 100);
Fw.PrintTextOnScreen(kupa, 0, 127, 0, 8, 0);
Fw.FlushFramebufferToScreen();
}

Wyświetl plik

@ -147,7 +147,6 @@ public:
Display.PrintFixedDigitsNumber2(u32Peak);
memcpy(FwData.pDisplayBuffer + 128 * 2 + u8PeakPos - 3, FwData.pSmallLeters + 18 + 5, 7);
Fw.FlushFramebufferToScreen();
}
@ -227,4 +226,5 @@ private:
unsigned char u8LastBtnPressed;
unsigned char u8ResolutionDiv;
bool bEnabled;
char C8Info[20];
};