diff --git a/src/drv/hasp_drv_display.cpp b/src/drv/hasp_drv_display.cpp index e211fb1a..3276c19e 100644 --- a/src/drv/hasp_drv_display.cpp +++ b/src/drv/hasp_drv_display.cpp @@ -12,15 +12,15 @@ void m5stack_init() Axp.begin(); Axp.SetCHGCurrent(AXP192::kCHG_100mA); - Axp.SetLcdVoltage(3300); + Axp.SetLcdVoltage(2800); Axp.SetBusPowerMode(0); Axp.SetCHGCurrent(AXP192::kCHG_190mA); - // Axp.SetLDOEnable(3, true); + Axp.SetLDOEnable(3, true); // CoverScrollText("Motor Test", M5.Lcd.color565(SUCCE_COLOR)); - // delay(150); - // Axp.SetLDOEnable(3, false); + delay(150); + Axp.SetLDOEnable(3, false); Axp.SetLed(1); // CoverScrollText("LED Test", M5.Lcd.color565(SUCCE_COLOR)); @@ -34,7 +34,7 @@ void m5stack_init() // FastLED.show(); Axp.SetLDOVoltage(3, 3300); - // Axp.SetLed(1); + Axp.SetLed(1); } #endif diff --git a/src/drv/hasp_drv_ft6336u.cpp b/src/drv/hasp_drv_ft6336u.cpp index 4884c56c..56808c17 100644 --- a/src/drv/hasp_drv_ft6336u.cpp +++ b/src/drv/hasp_drv_ft6336u.cpp @@ -13,21 +13,10 @@ FT6336U * touchpanel; // Read touch points bool IRAM_ATTR FT6336U_getXY(int16_t * touchX, int16_t * touchY, bool debug) { - FT6336U_TouchPointType tp = touchpanel->scan(); + if(touchpanel->read_touch_number() != 1) return false; - if(tp.touch_count != 1) return false; - - if(debug) { - char tempString[128]; - sprintf(tempString, "FT6336U TD Count %d / TD1 (%d, %4d, %4d) / TD2 (%d, %4d, %4d)\r", tp.touch_count, - tp.tp[0].status, tp.tp[0].x, tp.tp[0].y, tp.tp[1].status, tp.tp[1].x, tp.tp[1].y); - Serial.print(tempString); - } - - int i = 0; // tp.tp[0].status == TouchStatusEnum::touch ? 0 : 1; - - *touchX = TFT_WIDTH - tp.tp[i].y; - *touchY = tp.tp[i].x; + *touchX = TFT_WIDTH - touchpanel->read_touch1_y(); + *touchY = touchpanel->read_touch1_y(); return true; }