diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index ddd7906..10f23f7 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -49,7 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ format('release-{0}', github.run_number) }} - release_name: ${{ format('Release \#{0} for Project, {1}', github.run_number, steps.date.outputs.date) }} + release_name: ${{ format('Release {0}, {1}', github.run_number, steps.date.outputs.date) }} draft: false prerelease: false diff --git a/src/rssi_sbar/rssi_sbar.hpp b/src/rssi_sbar/rssi_sbar.hpp index eaaa14b..865373a 100644 --- a/src/rssi_sbar/rssi_sbar.hpp +++ b/src/rssi_sbar/rssi_sbar.hpp @@ -5,11 +5,14 @@ class CRssiPrinter { public: - static constexpr auto ChartStartX = 4*7 + 4; + static constexpr auto ChartStartX = 32; + static constexpr auto BlockSizeX = 4; + static constexpr auto BlockSizeY = 8; + static constexpr auto BlockSpace = 1; + static constexpr auto BlocksCnt = (128 - ChartStartX) / (BlockSizeX + BlockSpace); static void Handle(const System::TOrgFunctions& Fw, const System::TOrgData& FwData) { static bool bIsCleared = true; - static unsigned char u8ChartPosition = 0; static unsigned char u8SqlDelayCnt = 0xFF; TUV_K5Display DisplayBuff(FwData.pDisplayBuffer); @@ -34,7 +37,6 @@ class CRssiPrinter bIsCleared = true; auto* pDData = (unsigned char*)DisplayBuff.GetCoursorData(DisplayBuff.GetCoursorPosition(3, 0)); memset(pDData, 0, DisplayBuff.SizeX); - u8ChartPosition = 0; if(*pMenuCheckData != 0xFF) { Fw.FlushFramebufferToScreen(); @@ -46,6 +48,9 @@ class CRssiPrinter u8SqlDelayCnt++; bIsCleared = false; + + auto* pDData = (unsigned char*)DisplayBuff.GetCoursorData(DisplayBuff.GetCoursorPosition(3, 0)); + memset(pDData, 0, DisplayBuff.SizeX); Display.SetCoursor(3, 0); Display.SetFont(&FontSmallNr); @@ -73,28 +78,18 @@ class CRssiPrinter C8RssiString[3] = '0' + u8Rssi % 10; Display.Print(C8RssiString); - - if(u8ChartPosition < ChartStartX || u8ChartPosition >= TUV_K5Display::SizeX) - u8ChartPosition = ChartStartX; - - // unsigned char u8Sub = (u8Rssi * 7) >> 7; - // unsigned char u8PrintShift = (u8Sub > 7 ? 7 : u8Sub); + unsigned char u8Sub = (u8Rssi * BlocksCnt) >> 7; + unsigned char u8BlocksToFill = (u8Sub > BlocksCnt ? BlocksCnt : u8Sub); + u8BlocksToFill = BlocksCnt - u8BlocksToFill; + for(unsigned char i = 0; i < u8BlocksToFill; i++) + { + unsigned char u8X = i * (BlockSizeX + BlockSpace) + ChartStartX; + Display.DrawRectangle(u8X, 24, BlockSizeX, BlockSizeY, true); + } // Turn the proper pixel on, and the ones below it on as well // The code to turn just the correct pixel on is: U8ScreenHistory[u8ChartPosition - ChartStartX] = (1 << u8PrintShift) & 0xFF; // U8ScreenHistory[u8ChartPosition - ChartStartX] = ~(0xFF >> (7 - u8PrintShift)); - if(u8ChartPosition + 4 < DisplayBuff.SizeX) - { - for(unsigned char i = 0; i < 4; i++) - { - // U8ScreenHistory[u8ChartPosition - ChartStartX + i + 1] = 0; - } - } - - // auto* pDData = (unsigned char*)DisplayBuff.GetCoursorData(DisplayBuff.GetCoursorPosition(3, 0) + ChartStartX); - // memcpy(pDData, U8ScreenHistory, sizeof(U8ScreenHistory)); - - u8ChartPosition++; Fw.FlushFramebufferToScreen(); } }; \ No newline at end of file