mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Minor driver tweaks
This commit is contained in:
parent
7c4537225b
commit
ac2aa275c5
@ -151,7 +151,6 @@ static lv_fs_res_t fs_open(lv_fs_drv_t* drv, void* file_p, const char* path, lv_
|
||||
sprintf(buf, LV_FS_PC_PATH "\\%s", path);
|
||||
#endif
|
||||
|
||||
LV_LOG_USER(LV_FS_PC_PATH "/%%s");
|
||||
LV_LOG_USER(buf);
|
||||
|
||||
file_t f = fopen(buf, flags);
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#define BACKLIGHT_CHANNEL 0
|
||||
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
uint8_t temprature_sens_read();
|
||||
#endif
|
||||
|
||||
@ -425,7 +425,7 @@ void Esp32Device::get_info(JsonDocument& doc)
|
||||
|
||||
void Esp32Device::get_sensors(JsonDocument& doc)
|
||||
{
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
JsonObject sensor = doc.createNestedObject(F("ESP32"));
|
||||
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
|
||||
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
|
||||
|
@ -55,9 +55,9 @@ void TftEspi::show_info()
|
||||
// if(tftSetup.r3_y_offset != 0) Serial.printf("R3 y offset = %i \n", tftSetup.r3_y_offset);
|
||||
*/
|
||||
|
||||
tftPinInfo(F("MOSI"), tftSetup.pin_tft_mosi);
|
||||
tftPinInfo(F("MISO"), tftSetup.pin_tft_miso);
|
||||
tftPinInfo(F("SCLK"), tftSetup.pin_tft_clk);
|
||||
tftPinInfo(F("TFT_MOSI"), tftSetup.pin_tft_mosi);
|
||||
tftPinInfo(F("TFT_MISO"), tftSetup.pin_tft_miso);
|
||||
tftPinInfo(F("TFT_SCLK"), tftSetup.pin_tft_clk);
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
if(tftSetup.overlap == true) {
|
||||
@ -115,7 +115,7 @@ void TftEspi::splashscreen()
|
||||
|
||||
void TftEspi::set_rotation(uint8_t rotation)
|
||||
{
|
||||
LOG_VERBOSE(TAG_TFT, F("Rotation : %d"), rotation);
|
||||
LOG_VERBOSE(TAG_TFT, F("Rotation : %d"), rotation);
|
||||
tft.setRotation(rotation);
|
||||
}
|
||||
|
||||
@ -124,24 +124,24 @@ void TftEspi::set_invert(bool invert)
|
||||
char buffer[4];
|
||||
memcpy_P(buffer, invert ? PSTR(D_YES) : PSTR(D_NO), sizeof(buffer));
|
||||
|
||||
LOG_VERBOSE(TAG_TFT, F("Invert Disp: %s"), buffer);
|
||||
LOG_VERBOSE(TAG_TFT, F("Invert Color: %s"), buffer);
|
||||
tft.invertDisplay(invert);
|
||||
}
|
||||
|
||||
/* Update TFT */
|
||||
void IRAM_ATTR TftEspi::flush_pixels(lv_disp_drv_t* disp, const lv_area_t* area, lv_color_t* color_p)
|
||||
{
|
||||
uint32_t w = (area->x2 - area->x1 + 1);
|
||||
uint32_t h = (area->y2 - area->y1 + 1);
|
||||
uint32_t w = (area->x2 - area->x1 + 1);
|
||||
uint32_t h = (area->y2 - area->y1 + 1);
|
||||
uint32_t len = w * h;
|
||||
|
||||
#ifdef USE_DMA_TO_TFT
|
||||
tft.startWrite(); /* Start new TFT transaction */
|
||||
tft.startWrite(); /* Start new TFT transaction */
|
||||
tft.setAddrWindow(area->x1, area->y1, w, h); /* set the working window */
|
||||
tft.pushPixelsDMA((uint16_t*)color_p, len); /* Write words at once */
|
||||
tft.endWrite(); /* terminate TFT transaction */
|
||||
#else
|
||||
tft.startWrite(); /* Start new TFT transaction */
|
||||
tft.startWrite(); /* Start new TFT transaction */
|
||||
tft.setAddrWindow(area->x1, area->y1, w, h); /* set the working window */
|
||||
tft.pushPixels((uint16_t*)color_p, len); /* Write words at once */
|
||||
tft.endWrite(); /* terminate TFT transaction */
|
||||
|
@ -62,7 +62,7 @@ class TftEspi : BaseTft {
|
||||
{
|
||||
if(pin != -1) {
|
||||
char buffer[64];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("%-11s: %s (GPIO %02d)"), String(pinfunction).c_str(),
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("%-12s: %s (GPIO %02d)"), String(pinfunction).c_str(),
|
||||
haspDevice.gpio_name(pin).c_str(), pin);
|
||||
LOG_VERBOSE(TAG_TFT, buffer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user