Skip to content

Commit

Permalink
extra TICK_CYCLE
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 10, 2023
1 parent 4062d76 commit 0b81333
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions Marlin/src/lcd/extui/mks_ui/tft_lvgl_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,8 @@ void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv
W25QXX.init(SPI_QUARTER_SPEED);
}

#define TICK_CYCLE 1

uint16_t getTickDiff(const uint16_t curTick, const uint16_t lastTick) {
return TICK_CYCLE * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
return (TICK_CYCLE) * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
}

static bool get_point(int16_t *x, int16_t *y) {
Expand Down
11 changes: 5 additions & 6 deletions Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extern bool flash_dma_mode;
uint32_t getWifiTick() { return millis(); }

uint32_t getWifiTickDiff(const int32_t lastTick, const int32_t curTick) {
return TICK_CYCLE * (lastTick <= curTick ? curTick - lastTick : 0xFFFFFFFF - lastTick + curTick);
return (TICK_CYCLE) * (lastTick <= curTick ? curTick - lastTick : 0xFFFFFFFF - lastTick + curTick);
}

void wifi_delay(int n) {
Expand All @@ -133,11 +133,10 @@ void wifi_reset() {
WIFI_SET();
}

void mount_file_sys(uint8_t disk_type) {
if (disk_type == FILE_SYS_SD) {
TERN_(SDSUPPORT, card.mount());
}
else if (disk_type == FILE_SYS_USB) {
void mount_file_sys(const uint8_t disk_type) {
switch (disk_type) {
case FILE_SYS_SD: TERN_(SDSUPPORT, card.mount()); break;
case FILE_SYS_USB: break;
}
}

Expand Down

0 comments on commit 0b81333

Please sign in to comment.