diff --git a/src/eez/gui/event.cpp b/src/eez/gui/event.cpp index 787f6b28b..5593f58e4 100644 --- a/src/eez/gui/event.cpp +++ b/src/eez/gui/event.cpp @@ -44,8 +44,6 @@ static uint32_t m_touchDownTime; static uint32_t m_lastAutoRepeatEventTime; static bool m_longTouchGenerated; static bool m_extraLongTouchGenerated; -static int m_lastTouchMoveX = -1; -static int m_lastTouchMoveY = -1; void processTouchEvent(EventType type); void onPageTouch(const WidgetCursor &foundWidget, Event &touchEvent); @@ -107,18 +105,6 @@ void processTouchEvent(EventType type) { m_onTouchFunction = onPageTouch; } } -#if defined(EEZ_PLATFORM_STM32) - else if (type == EVENT_TYPE_TOUCH_MOVE) { - // ignore EVENT_TYPE_TOUCH_MOVE if it is the same as the last event - // or change is too big - int dx = (m_lastTouchMoveX - x); - int dy = (m_lastTouchMoveY - y); - int d = dx * dx + dy * dy; - if (d == 0 || d > 1000) { - return; - } - } -#endif else if (type == EVENT_TYPE_TOUCH_UP) { m_activeWidget = 0; } @@ -131,9 +117,6 @@ void processTouchEvent(EventType type) { m_onTouchFunction(m_foundWidgetAtDown, event); } - - m_lastTouchMoveX = x; - m_lastTouchMoveY = y; } OnTouchFunctionType getTouchFunction(const WidgetCursor &widgetCursor) { diff --git a/src/eez/modules/psu/dlog_record.cpp b/src/eez/modules/psu/dlog_record.cpp index aeb7bcfac..9a4ed211e 100644 --- a/src/eez/modules/psu/dlog_record.cpp +++ b/src/eez/modules/psu/dlog_record.cpp @@ -196,10 +196,7 @@ void fileWrite() { err = event_queue::EVENT_ERROR_DLOG_FILE_REOPEN_ERROR; } - if (!sd_card::remount()) { - err = SCPI_ERROR_MASS_STORAGE_ERROR; - break; - } + sd_card::reinitialize(); } event_queue::pushEvent(err); diff --git a/src/eez/modules/psu/list_program.cpp b/src/eez/modules/psu/list_program.cpp index 109cde391..d50e2ea78 100644 --- a/src/eez/modules/psu/list_program.cpp +++ b/src/eez/modules/psu/list_program.cpp @@ -474,9 +474,7 @@ bool saveList( } } - if (!sd_card::remount()) { - break; - } + sd_card::reinitialize(); } if (err) { diff --git a/src/eez/modules/psu/profile.cpp b/src/eez/modules/psu/profile.cpp index 95a72dd21..487c7cb92 100644 --- a/src/eez/modules/psu/profile.cpp +++ b/src/eez/modules/psu/profile.cpp @@ -1079,9 +1079,7 @@ static bool saveProfileToFile(const char *filePath, Parameters &profile, List *l } } - if (!sd_card::remount()) { - break; - } + sd_card::reinitialize(); } if (err) { diff --git a/src/eez/modules/psu/sd_card.cpp b/src/eez/modules/psu/sd_card.cpp index b4fa460d7..a58a94da0 100644 --- a/src/eez/modules/psu/sd_card.cpp +++ b/src/eez/modules/psu/sd_card.cpp @@ -135,13 +135,11 @@ void onSdDetectInterruptHandler() { } #endif -bool remount() { - SD.unmount(); +void reinitialize() { #if defined(EEZ_PLATFORM_STM32) FATFS_UnLinkDriver(SDPath); MX_FATFS_Init(); #endif - return SD.mount(&g_lastError); } bool isMounted(int *err) { @@ -366,11 +364,7 @@ bool download(const char *filePath, bool truncate, const void *buffer, size_t si } } - if (!sd_card::remount()) { - err = SCPI_ERROR_MASS_STORAGE_ERROR; - break; - } - + sd_card::reinitialize(); bool ropened = false; @@ -382,10 +376,7 @@ bool download(const char *filePath, bool truncate, const void *buffer, size_t si } } - if (!sd_card::remount()) { - err = SCPI_ERROR_MASS_STORAGE_ERROR; - break; - } + sd_card::reinitialize(); } if (!ropened) { @@ -393,7 +384,7 @@ bool download(const char *filePath, bool truncate, const void *buffer, size_t si } } - sd_card::remount(); + sd_card::reinitialize(); if (perr) { *perr = err; diff --git a/src/eez/modules/psu/sd_card.h b/src/eez/modules/psu/sd_card.h index f2edc42c5..1a9dc87b3 100644 --- a/src/eez/modules/psu/sd_card.h +++ b/src/eez/modules/psu/sd_card.h @@ -44,7 +44,7 @@ void onSdDetectInterrupt(); void onSdDetectInterruptHandler(); #endif -bool remount(); +void reinitialize(); bool isMounted(int *err); bool isBusy(); diff --git a/src/eez/scpi/scpi.cpp b/src/eez/scpi/scpi.cpp index c6c019e4f..13e7237c7 100644 --- a/src/eez/scpi/scpi.cpp +++ b/src/eez/scpi/scpi.cpp @@ -222,11 +222,7 @@ void oneIter() { } } - if (!sd_card::remount()) { - event_queue::pushEvent(SCPI_ERROR_MASS_STORAGE_ERROR); - g_screenshotGenerating = false; - return; - } + sd_card::reinitialize(); } // timeout