mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 06:41:25 +03:00
Fixed LAST_CHANNEL compile problem (missing comma)
This commit is contained in:
parent
99bff425d6
commit
b9bd049dc9
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdio.h> // NULL
|
||||||
|
|
||||||
#include "bsp/dp32g030/gpio.h"
|
#include "bsp/dp32g030/gpio.h"
|
||||||
#include "bsp/dp32g030/spi.h"
|
#include "bsp/dp32g030/spi.h"
|
||||||
@ -27,9 +28,9 @@
|
|||||||
uint8_t gStatusLine[128];
|
uint8_t gStatusLine[128];
|
||||||
uint8_t gFrameBuffer[7][128];
|
uint8_t gFrameBuffer[7][128];
|
||||||
|
|
||||||
void ST7565_DrawLine(uint8_t Column, uint8_t Line, uint16_t Size, const uint8_t *pBitmap, bool bIsClearMode)
|
void ST7565_DrawLine(const unsigned int Column, const unsigned int Line, const unsigned int Size, const uint8_t *pBitmap)
|
||||||
{
|
{
|
||||||
uint16_t i;
|
unsigned int i;
|
||||||
|
|
||||||
SPI_ToggleMasterMode(&SPI0->CR, false);
|
SPI_ToggleMasterMode(&SPI0->CR, false);
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ void ST7565_DrawLine(uint8_t Column, uint8_t Line, uint16_t Size, const uint8_t
|
|||||||
|
|
||||||
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_ST7565_A0);
|
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_ST7565_A0);
|
||||||
|
|
||||||
if (!bIsClearMode)
|
if (pBitmap != NULL)
|
||||||
{
|
{
|
||||||
for (i = 0; i < Size; i++)
|
for (i = 0; i < Size; i++)
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
extern uint8_t gStatusLine[128];
|
extern uint8_t gStatusLine[128];
|
||||||
extern uint8_t gFrameBuffer[7][128];
|
extern uint8_t gFrameBuffer[7][128];
|
||||||
|
|
||||||
void ST7565_DrawLine(uint8_t Column, uint8_t Line, uint16_t Size, const uint8_t *pBitmap, bool bIsClearMode);
|
void ST7565_DrawLine(const unsigned int Column, const unsigned int Line, const unsigned int Size, const uint8_t *pBitmap);
|
||||||
void ST7565_BlitFullScreen(void);
|
void ST7565_BlitFullScreen(void);
|
||||||
void ST7565_BlitStatusLine(void);
|
void ST7565_BlitStatusLine(void);
|
||||||
void ST7565_FillScreen(uint8_t Value);
|
void ST7565_FillScreen(uint8_t Value);
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
10
misc.h
10
misc.h
@ -20,6 +20,10 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef ARRAY_SIZE
|
||||||
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IS_MR_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= MR_CHANNEL_LAST)
|
#define IS_MR_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= MR_CHANNEL_LAST)
|
||||||
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
#define IS_FREQ_CHANNEL(x) ((x) >= FREQ_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
||||||
#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL)
|
#define IS_VALID_CHANNEL(x) ((x) < LAST_CHANNEL)
|
||||||
@ -29,10 +33,6 @@
|
|||||||
#define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
#define IS_NOT_NOAA_CHANNEL(x) ((x) >= MR_CHANNEL_FIRST && (x) <= FREQ_CHANNEL_LAST)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
|
||||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MR_CHANNEL_FIRST = 0,
|
MR_CHANNEL_FIRST = 0,
|
||||||
MR_CHANNEL_LAST = 199u,
|
MR_CHANNEL_LAST = 199u,
|
||||||
@ -40,7 +40,7 @@ enum {
|
|||||||
FREQ_CHANNEL_LAST = 206u,
|
FREQ_CHANNEL_LAST = 206u,
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
NOAA_CHANNEL_FIRST = 207u,
|
NOAA_CHANNEL_FIRST = 207u,
|
||||||
NOAA_CHANNEL_LAST = 216u
|
NOAA_CHANNEL_LAST = 216u,
|
||||||
#endif
|
#endif
|
||||||
LAST_CHANNEL
|
LAST_CHANNEL
|
||||||
};
|
};
|
||||||
|
36
ui/battery.c
36
ui/battery.c
@ -22,37 +22,21 @@
|
|||||||
|
|
||||||
void UI_DisplayBattery(uint8_t Level)
|
void UI_DisplayBattery(uint8_t Level)
|
||||||
{
|
{
|
||||||
const uint8_t *pBitmap;
|
if (gCurrentFunction != FUNCTION_TRANSMIT)
|
||||||
bool bClearMode = false;
|
|
||||||
|
|
||||||
if (gCurrentFunction != 1)
|
|
||||||
{
|
{
|
||||||
const unsigned int x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel5);
|
const unsigned int x = LCD_WIDTH - sizeof(BITMAP_BatteryLevel5);
|
||||||
|
const uint8_t *pBitmap = NULL;
|
||||||
switch (Level)
|
switch (Level)
|
||||||
{
|
{
|
||||||
case 0:
|
|
||||||
pBitmap = NULL;
|
|
||||||
bClearMode = true;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
pBitmap = BITMAP_BatteryLevel1;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
pBitmap = BITMAP_BatteryLevel2;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pBitmap = BITMAP_BatteryLevel3;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
pBitmap = BITMAP_BatteryLevel4;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
pBitmap = BITMAP_BatteryLevel5;
|
case 0: break;
|
||||||
break;
|
case 1: pBitmap = BITMAP_BatteryLevel1; break;
|
||||||
|
case 2: pBitmap = BITMAP_BatteryLevel2; break;
|
||||||
|
case 3: pBitmap = BITMAP_BatteryLevel3; break;
|
||||||
|
case 4: pBitmap = BITMAP_BatteryLevel4; break;
|
||||||
|
case 5: pBitmap = BITMAP_BatteryLevel5; break;
|
||||||
}
|
}
|
||||||
|
// col lne, siz, bm
|
||||||
// col lne, siz, bm, clr/set-pixels
|
ST7565_DrawLine(x, 0, 18, pBitmap);
|
||||||
ST7565_DrawLine(x, 0, 18, pBitmap, bClearMode);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ void Render(const uint8_t rssi, const uint8_t RssiLevel, const uint8_t VFO)
|
|||||||
memmove(pLine + 20, BITMAP_AntennaLevel6, sizeof(BITMAP_AntennaLevel6));
|
memmove(pLine + 20, BITMAP_AntennaLevel6, sizeof(BITMAP_AntennaLevel6));
|
||||||
}
|
}
|
||||||
|
|
||||||
ST7565_DrawLine(0, Line, 23, pLine, (pLine == NULL) ? true : false);
|
ST7565_DrawLine(0, Line, 23, pLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_UpdateRSSI(uint16_t RSSI)
|
void UI_UpdateRSSI(uint16_t RSSI)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user