v0.6.530
This commit is contained in:
@@ -12,6 +12,12 @@
|
||||
#define DEF_SPI_FREQ 24000000 /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#if ENABLE_VU_METER
|
||||
#define CLOCK_DELTA 16
|
||||
#else
|
||||
#define CLOCK_DELTA 0
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() if(player.mutex_pl) xSemaphoreTake(player.mutex_pl, portMAX_DELAY)
|
||||
#define GIVE_MUTEX() if(player.mutex_pl) xSemaphoreGive(player.mutex_pl)
|
||||
|
||||
@@ -238,10 +244,10 @@ void DspCore::printClock(struct tm timeinfo, bool dots, bool redraw){
|
||||
setFont(&DS_DIGI28pt7b);
|
||||
if(strstr(oldTimeBuf, timeBuf)==NULL || redraw){
|
||||
getTextBounds(oldTimeBuf, 0, 0, &x, &y, &wot, &hot);
|
||||
setCursor((swidth - wot) / 2 - 4, clockY+28+6);
|
||||
setCursor((swidth - wot) / 2 - 4 + CLOCK_DELTA, clockY+28+6);
|
||||
setTextColor(TFT_BG);
|
||||
print(oldTimeBuf);
|
||||
dot = (swidth - wot) / 2 - 4;
|
||||
dot = (swidth - wot) / 2 - 4 + CLOCK_DELTA;
|
||||
/* dots */
|
||||
strlcpy(tmpBuf, oldTimeBuf, 3);
|
||||
getTextBounds(tmpBuf, 0, 0, &x, &y, &ncwidth, &ncheight);
|
||||
@@ -254,8 +260,8 @@ void DspCore::printClock(struct tm timeinfo, bool dots, bool redraw){
|
||||
setTextSize(1);
|
||||
getTextBounds(timeBuf, 0, 0, &x, &y, &ncwidth, &ncheight);
|
||||
setTextColor(TFT_LOGO);
|
||||
setCursor((swidth - ncwidth) / 2 - 4, clockY+28+6);
|
||||
dot = (swidth - ncwidth) / 2 - 4;
|
||||
setCursor((swidth - ncwidth) / 2 - 4 + CLOCK_DELTA, clockY+28+6);
|
||||
dot = (swidth - ncwidth) / 2 - 4 + CLOCK_DELTA;
|
||||
setTextSize(1);
|
||||
print(timeBuf);
|
||||
/* dots */
|
||||
|
||||
@@ -444,4 +444,10 @@ void DspCore::loop(bool force) {
|
||||
|
||||
}
|
||||
|
||||
void DspCore::drawRGBBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h) {
|
||||
TAKE_MUTEX();
|
||||
drawBitmap(x, y, bitmap, w, h);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define displayILI9225_h
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "TFT_22_ILI9225.h"
|
||||
#include "../ILI9225Fix/TFT_22_ILI9225Fix.h"
|
||||
#include "fonts/DS_DIGI28pt7b.h"
|
||||
|
||||
#define TFT_LINEHGHT 10
|
||||
@@ -72,6 +72,7 @@ class DspCore: public TFT_22_ILI9225 {
|
||||
uint16_t color);
|
||||
int16_t width(void) { return (int16_t)maxX(); }
|
||||
int16_t height(void) { return (int16_t)maxY(); }
|
||||
void drawRGBBitmap(int16_t x, int16_t y, const uint16_t *bitmap, int16_t w, int16_t h);
|
||||
private:
|
||||
uint16_t swidth, sheight;
|
||||
uint16_t bgcolor, fgcolor;
|
||||
|
||||
@@ -121,7 +121,6 @@ void DspCore::initD(uint16_t &screenwidth, uint16_t &screenheight) {
|
||||
setTextSize(1);
|
||||
screenwidth = width();
|
||||
screenheight = height();
|
||||
Serial.printf("ILI9341 %dx%d\n", screenwidth, screenheight);
|
||||
swidth = screenwidth;
|
||||
sheight = screenheight;
|
||||
}
|
||||
|
||||
@@ -16,12 +16,20 @@
|
||||
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#if ENABLE_VU_METER && DTYPE==INITR_BLACKTAB
|
||||
#if ENABLE_VU_METER
|
||||
|
||||
#if DTYPE==INITR_BLACKTAB
|
||||
#define CLOCK_DELTA 12
|
||||
#elif DTYPE==INITR_MINI160x80
|
||||
#define CLOCK_DELTA 16
|
||||
#else
|
||||
#define CLOCK_DELTA 0
|
||||
#endif
|
||||
|
||||
#else // !ENABLE_VU_METER
|
||||
#define CLOCK_DELTA 0
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() if(player.mutex_pl) xSemaphoreTake(player.mutex_pl, portMAX_DELAY)
|
||||
#define GIVE_MUTEX() if(player.mutex_pl) xSemaphoreGive(player.mutex_pl)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user