minor cleanup and optimizations

This commit is contained in:
ionsurdu@github.com
2024-08-13 14:49:51 +03:00
parent d2c02b62eb
commit b388ef6fdc
3 changed files with 176 additions and 192 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ void DFRobot_OSD::displayChar(unsigned char row, unsigned char col, unsigned sho
writeAddrData(DMM, 0x40);
writeAddrData(DMAH, addrH | 0x2);
writeAddrData(DMAL, k);
j = CHAR_LBC << 5;
j = CHAR_LBC;
if ((addr >> 8) != 0)
j |= 0x10;
writeAddrData(DMDI, j);
@@ -100,7 +100,7 @@ void DFRobot_OSD::displayString(unsigned char row, unsigned char col, const char
writeAddrData(DMM, 0x40);
writeAddrData(DMAH, addrH | 0x2);
writeAddrData(DMAL, k);
j = CHAR_LBC << 5;
j = CHAR_LBC;
if ((value >> 8) != 0)
j |= 0x10;
writeAddrData(DMDI, j);
@@ -157,7 +157,7 @@ void DFRobot_OSD::writeAT7456E(unsigned short addr, int *dt)
writeAddrData(VM0, 0x01 << 3);
}
void DFRobot_OSD::storeChar(unsigned short addr, int temp[])
void DFRobot_OSD::storeChar(unsigned short addr, const int temp[])
{
int buf[54] = {0};
int dt[54] = {0};
+12 -10
View File
@@ -37,19 +37,21 @@
#define OSD_X_START 1
#define OSD_Y_START 16
int osd_chart_buffer[OSD_CHART_WIDTH];
DFRobot_OSD osd(CS);
/*Define Chinese characters*/
int buf0[36] = {0x02, 0x80, 0x02, 0x40, 0x7F, 0xE0, 0x42, 0x00, 0x42, 0x00, 0x7A, 0x40,
0x4A, 0x40, 0x4A, 0x80, 0x49, 0x20, 0x5A, 0xA0, 0x44, 0x60, 0x88, 0x20};
int buf1[36] = {0x20, 0x00, 0x25, 0xE0, 0x75, 0x20, 0x29, 0x20, 0xFD, 0x40, 0x21, 0x40,
0x7D, 0x20, 0xC5, 0x20, 0x7D, 0x20, 0x45, 0xC0, 0x7D, 0x00, 0x45, 0x00};
int buf2[36] = {0x20, 0x00, 0x2F, 0xC0, 0x24, 0x40, 0xF4, 0x40, 0x24, 0x80, 0x64, 0xE0,
0x74, 0x20, 0xA6, 0x20, 0x25, 0x40, 0x28, 0x80, 0x29, 0x40, 0x32, 0x20};
int buf3[36] = {0x3F, 0x00, 0x2A, 0xE0, 0xFA, 0x20, 0x2E, 0xA0, 0x2A, 0xA0, 0xFE, 0xA0,
0x2A, 0x40, 0xAB, 0x40, 0xBE, 0xA0, 0xA3, 0x20, 0xE2, 0x00, 0xBF, 0xE0};
static const int buf0[36] = {0x02, 0x80, 0x02, 0x40, 0x7F, 0xE0, 0x42, 0x00,
0x42, 0x00, 0x7A, 0x40, 0x4A, 0x40, 0x4A, 0x80,
0x49, 0x20, 0x5A, 0xA0, 0x44, 0x60, 0x88, 0x20};
static const int buf1[36] = {0x20, 0x00, 0x25, 0xE0, 0x75, 0x20, 0x29, 0x20,
0xFD, 0x40, 0x21, 0x40, 0x7D, 0x20, 0xC5, 0x20,
0x7D, 0x20, 0x45, 0xC0, 0x7D, 0x00, 0x45, 0x00};
static const int buf2[36] = {0x20, 0x00, 0x2F, 0xC0, 0x24, 0x40, 0xF4, 0x40,
0x24, 0x80, 0x64, 0xE0, 0x74, 0x20, 0xA6, 0x20,
0x25, 0x40, 0x28, 0x80, 0x29, 0x40, 0x32, 0x20};
static const int buf3[36] = {0x3F, 0x00, 0x2A, 0xE0, 0xFA, 0x20, 0x2E, 0xA0,
0x2A, 0xA0, 0xFE, 0xA0, 0x2A, 0x40, 0xAB, 0x40,
0xBE, 0xA0, 0xA3, 0x20, 0xE2, 0x00, 0xBF, 0xE0};
// SPI pins
// .pio/libdeps/heltec_wifi_lora_32_V3/Heltec_ESP32_LoRa_v3/src/heltec_unofficial.h#L34-L35