v0.9.337b
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "displayGC9106.h"
|
||||
#include "fonts/bootlogo40.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -11,9 +10,6 @@
|
||||
#define DEF_SPI_FREQ 24000000 /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_GC9106Ex(&SPI2, TFT_DC, TFT_CS, TFT_RST) {}
|
||||
#else
|
||||
@@ -134,13 +130,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_GC9106Ex::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_GC9106Ex::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) { }
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "displayGC9A01A.h"
|
||||
//#include <SPI.h>
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -12,9 +11,6 @@
|
||||
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_GC9A01A(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
|
||||
#else
|
||||
@@ -166,13 +162,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_GC9A01A::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_GC9A01A::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
|
||||
@@ -6,14 +6,10 @@
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
#include "../core/spidog.h"
|
||||
|
||||
extern unsigned char yofont5x7[];
|
||||
extern unsigned char yofont10x14[];
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
DspCore::DspCore(): TFT_22_ILI9225(TFT_RST, TFT_DC, TFT_CS, 0) {}
|
||||
|
||||
#include "tools/utf8RusGFX.h"
|
||||
@@ -40,13 +36,10 @@ void DspCore::setCursor(int16_t x, int16_t y){
|
||||
uint16_t DspCore::print(const char* s){
|
||||
|
||||
if(_gFont){
|
||||
TAKE_MUTEX();
|
||||
drawGFXText(_cursorx, _cursory, s, _fgcolor);
|
||||
GIVE_MUTEX();
|
||||
return 0;
|
||||
}else{
|
||||
_cursorx=drawText(_cursorx, _cursory, s, _fgcolor);
|
||||
//GIVE_MUTEX();
|
||||
return _cursorx;
|
||||
}
|
||||
}
|
||||
@@ -70,31 +63,22 @@ void DspCore::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t colo
|
||||
h=h+y;
|
||||
y=0;
|
||||
}
|
||||
TAKE_MUTEX();
|
||||
fillRectangle(x, y, x+w, y+h, color);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color){
|
||||
TAKE_MUTEX();
|
||||
drawRectangle(x, y, x+w, y+h, color);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color){
|
||||
TAKE_MUTEX();
|
||||
drawLine(x, y, x, y+h, color);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color){
|
||||
TAKE_MUTEX();
|
||||
drawLine(x, y, x+w, y, color);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::initDisplay() {
|
||||
// TAKE_MUTEX();
|
||||
#if DSP_HSPI
|
||||
begin(SPI2);
|
||||
#else
|
||||
@@ -103,7 +87,6 @@ void DspCore::initDisplay() {
|
||||
invert();
|
||||
flip();
|
||||
setTextSize(1);
|
||||
// GIVE_MUTEX();
|
||||
plItemHeight = playlistConf.widget.textsize*(CHARHEIGHT-1)+playlistConf.widget.textsize*4;
|
||||
plTtemsCount = round((float)height()/plItemHeight);
|
||||
if(plTtemsCount%2==0) plTtemsCount++;
|
||||
@@ -112,9 +95,7 @@ void DspCore::initDisplay() {
|
||||
}
|
||||
|
||||
void DspCore::drawLogo(uint16_t top) {
|
||||
TAKE_MUTEX();
|
||||
drawBitmap((width() - 99) / 2, top, bootlogo2, 99, 64);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::printPLitem(uint8_t pos, const char* item, ScrollWidget& current){
|
||||
@@ -138,9 +119,7 @@ void DspCore::drawPlaylist(uint16_t currentItem) {
|
||||
}
|
||||
|
||||
void DspCore::clearDsp(bool black) {
|
||||
TAKE_MUTEX();
|
||||
clear(black?0x0000:config.theme.background);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
GFXglyph *pgm_read_glyph_ptr(const GFXfont *gfxFont, uint8_t c) {
|
||||
@@ -232,13 +211,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
//TAKE_MUTEX();
|
||||
TFT_22_ILI9225::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
TFT_22_ILI9225::endWrite();
|
||||
//GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
@@ -251,24 +228,18 @@ void DspCore::charSize(uint8_t textsize, uint8_t& width, uint16_t& height){
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
void DspCore::flip(){
|
||||
TAKE_MUTEX();
|
||||
setOrientation(config.store.flipscreen?3:1);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
void DspCore::invert(){
|
||||
TAKE_MUTEX();
|
||||
invertDisplay(config.store.invertdisplay);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::sleep(void) { TAKE_MUTEX(); setDisplay(false); GIVE_MUTEX(); }
|
||||
void DspCore::wake(void) { TAKE_MUTEX(); setDisplay(true); GIVE_MUTEX(); }
|
||||
void DspCore::sleep(void) { setDisplay(false); }
|
||||
void DspCore::wake(void) { setDisplay(true); }
|
||||
|
||||
void DspCore::writePixel(int16_t x, int16_t y, uint16_t color) { }
|
||||
|
||||
@@ -280,9 +251,7 @@ uint16_t DspCore::drawChar(uint16_t x, uint16_t y, uint16_t ch, uint16_t color)
|
||||
return cfont.width;
|
||||
}
|
||||
}
|
||||
TAKE_MUTEX();
|
||||
uint16_t ret=TFT_22_ILI9225::drawChar(x, y, ch, color);
|
||||
GIVE_MUTEX();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,9 @@
|
||||
|
||||
#include "displayILI9341.h"
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_ILI9341(&SPI2, TFT_DC, TFT_CS, TFT_RST) {}
|
||||
#else
|
||||
@@ -153,13 +149,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_ILI9341::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_ILI9341::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) { }
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "displayILI9488.h"
|
||||
//#include <SPI.h>
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -12,9 +11,6 @@
|
||||
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): ILI9486_SPI(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
|
||||
#else
|
||||
@@ -161,13 +157,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
ILI9486_SPI::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
ILI9486_SPI::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
@@ -188,9 +182,7 @@ void DspCore::flip(){
|
||||
}
|
||||
|
||||
void DspCore::invert(){
|
||||
TAKE_MUTEX();
|
||||
invertDisplay(config.store.invertdisplay);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::sleep(void) {
|
||||
|
||||
@@ -3,16 +3,12 @@
|
||||
|
||||
#include "displayN5110.h"
|
||||
#include <Wire.h>
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
#define LOGO_WIDTH 21
|
||||
#define LOGO_HEIGHT 28
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
const unsigned char logo [] PROGMEM=
|
||||
{
|
||||
0x07, 0x03, 0x80, 0x0f, 0x87, 0xc0, 0x0f, 0x87, 0xc0, 0x0f, 0x87, 0xc0, 0x0f, 0x87, 0xc0, 0x07,
|
||||
@@ -32,15 +28,11 @@ DspCore::DspCore(): Adafruit_PCD8544(TFT_DC, TFT_CS, TFT_RST) {}
|
||||
#include "tools/utf8RusGFX.h"
|
||||
|
||||
void DspCore::command(uint8_t c) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_PCD8544::command(c);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::data(uint8_t c) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_PCD8544::data(c);
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::initDisplay() {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#if DSP_MODEL==DSP_SSD1305 || DSP_MODEL==DSP_SSD1305I2C
|
||||
|
||||
#include "displaySSD1305.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -13,9 +12,6 @@
|
||||
#define LOGO_WIDTH 21
|
||||
#define LOGO_HEIGHT 32
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex(); digitalWrite(TFT_CS, LOW)
|
||||
#define GIVE_MUTEX() digitalWrite(TFT_CS, HIGH); sdog.giveMutex()
|
||||
|
||||
#ifndef DEF_SPI_FREQ
|
||||
#define DEF_SPI_FREQ 8000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
@@ -166,13 +162,7 @@ void DspCore::startWrite(void) { }
|
||||
void DspCore::endWrite(void) { }
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
TAKE_MUTEX();
|
||||
#endif
|
||||
display();
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
GIVE_MUTEX();
|
||||
#endif
|
||||
delay(5);
|
||||
}
|
||||
|
||||
@@ -186,42 +176,18 @@ void DspCore::setTextSize(uint8_t s){
|
||||
}
|
||||
|
||||
void DspCore::flip(){
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
TAKE_MUTEX();
|
||||
#endif
|
||||
setRotation(config.store.flipscreen?2:0);
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
GIVE_MUTEX();
|
||||
#endif
|
||||
}
|
||||
|
||||
void DspCore::invert(){
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
TAKE_MUTEX();
|
||||
#endif
|
||||
invertDisplay(config.store.invertdisplay);
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
GIVE_MUTEX();
|
||||
#endif
|
||||
}
|
||||
|
||||
void DspCore::sleep(void) {
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
TAKE_MUTEX();
|
||||
#endif
|
||||
oled_command(SSD1305_DISPLAYOFF);
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
GIVE_MUTEX();
|
||||
#endif
|
||||
}
|
||||
void DspCore::wake(void) {
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
TAKE_MUTEX();
|
||||
#endif
|
||||
oled_command(SSD1305_DISPLAYON);
|
||||
#if DSP_MODEL==DSP_SSD1305
|
||||
GIVE_MUTEX();
|
||||
#endif
|
||||
}
|
||||
|
||||
void DspCore::writePixel(int16_t x, int16_t y, uint16_t color) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "displayST7735.h"
|
||||
#include "fonts/bootlogo40.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -11,9 +10,6 @@
|
||||
#define DEF_SPI_FREQ 26000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_ST7735(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
|
||||
#else
|
||||
@@ -140,13 +136,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_ST7735::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_ST7735::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) { }
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "displayST7789.h"
|
||||
//#include <SPI.h>
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -12,9 +11,6 @@
|
||||
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_ST7789(&SPI2, TFT_CS, TFT_DC, TFT_RST) {}
|
||||
#else
|
||||
@@ -160,13 +156,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_ST7789::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_ST7789::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "displayST7796.h"
|
||||
//#include <SPI.h>
|
||||
#include "fonts/bootlogo.h"
|
||||
#include "../core/spidog.h"
|
||||
#include "../core/config.h"
|
||||
#include "../core/network.h"
|
||||
|
||||
@@ -12,9 +11,6 @@
|
||||
#define DEF_SPI_FREQ 40000000UL /* set it to 0 for system default */
|
||||
#endif
|
||||
|
||||
#define TAKE_MUTEX() sdog.takeMutex()
|
||||
#define GIVE_MUTEX() sdog.giveMutex()
|
||||
|
||||
#if DSP_HSPI
|
||||
DspCore::DspCore(): Adafruit_ST7796S_kbv(&SPI2, TFT_DC, TFT_CS, TFT_RST) {}
|
||||
#else
|
||||
@@ -160,13 +156,11 @@ void DspCore::clearClock(){
|
||||
}
|
||||
|
||||
void DspCore::startWrite(void) {
|
||||
TAKE_MUTEX();
|
||||
Adafruit_ST7796S_kbv::startWrite();
|
||||
}
|
||||
|
||||
void DspCore::endWrite(void) {
|
||||
Adafruit_ST7796S_kbv::endWrite();
|
||||
GIVE_MUTEX();
|
||||
}
|
||||
|
||||
void DspCore::loop(bool force) {
|
||||
|
||||
@@ -517,14 +517,14 @@ char* Nextion::utf8Rus(char* str, bool uppercase) {
|
||||
E = false;
|
||||
continue;
|
||||
}
|
||||
byte rus = (byte) * iter;
|
||||
if (rus == 208 && (byte) * (iter + 1) == 129) {
|
||||
uint8_t rus = (uint8_t) * iter;
|
||||
if (rus == 208 && (uint8_t) * (iter + 1) == 129) {
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
continue;
|
||||
}
|
||||
if (rus == 209 && (byte) * (iter + 1) == 145) {
|
||||
if (rus == 209 && (uint8_t) * (iter + 1) == 145) {
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
|
||||
@@ -14,14 +14,14 @@ char* DspCore::utf8Rus(const char* str, bool uppercase) {
|
||||
E = false;
|
||||
continue;
|
||||
}
|
||||
byte rus = (byte) * iter;
|
||||
if (rus == 208 && (byte) * (iter + 1) == 129) { // ёКостыли
|
||||
uint8_t rus = (uint8_t) * iter;
|
||||
if (rus == 208 && (uint8_t) * (iter + 1) == 129) { // ёКостыли
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
continue;
|
||||
}
|
||||
if (rus == 209 && (byte) * (iter + 1) == 145) {
|
||||
if (rus == 209 && (uint8_t) * (iter + 1) == 145) {
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
|
||||
@@ -15,14 +15,14 @@ char* DspCore::utf8Rus(const char* str, bool uppercase) {
|
||||
E = false;
|
||||
continue;
|
||||
}
|
||||
byte rus = (byte) * iter;
|
||||
if (rus == 208 && (byte) * (iter + 1) == 129) { // ёКостыли
|
||||
uint8_t rus = (uint8_t) * iter;
|
||||
if (rus == 208 && (uint8_t) * (iter + 1) == 129) { // ёКостыли
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
continue;
|
||||
}
|
||||
if (rus == 209 && (byte) * (iter + 1) == 145) {
|
||||
if (rus == 209 && (uint8_t) * (iter + 1) == 145) {
|
||||
*iter = (char)209;
|
||||
*(iter + 1) = (char)145;
|
||||
E = true;
|
||||
|
||||
Reference in New Issue
Block a user