My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

DGUSTxHandler.cpp 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2021 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../../../inc/MarlinConfigPre.h"
  23. #if ENABLED(DGUS_LCD_UI_RELOADED)
  24. #include "DGUSTxHandler.h"
  25. #include "DGUSScreenHandler.h"
  26. #include "config/DGUS_Data.h"
  27. #include "../ui_api.h"
  28. #include "../../../module/stepper.h"
  29. #include "../../../module/printcounter.h"
  30. #if ENABLED(ADVANCED_PAUSE_FEATURE)
  31. #include "../../../feature/pause.h"
  32. #endif
  33. #if ENABLED(SDSUPPORT)
  34. void DGUSTxHandler::SetFileControlState(int file, bool state) {
  35. DGUS_Control control;
  36. switch (file) {
  37. default: return;
  38. case 0:
  39. control = DGUS_Control::FILE0;
  40. break;
  41. case 1:
  42. control = DGUS_Control::FILE1;
  43. break;
  44. case 2:
  45. control = DGUS_Control::FILE2;
  46. break;
  47. case 3:
  48. control = DGUS_Control::FILE3;
  49. break;
  50. case 4:
  51. control = DGUS_Control::FILE4;
  52. break;
  53. }
  54. if (state) {
  55. dgus_display.EnableControl(DGUS_Screen::PRINT,
  56. DGUSDisplay::RETURN_KEY_CODE,
  57. control);
  58. }
  59. else {
  60. dgus_display.DisableControl(DGUS_Screen::PRINT,
  61. DGUSDisplay::RETURN_KEY_CODE,
  62. control);
  63. }
  64. }
  65. void DGUSTxHandler::FileType(DGUS_VP &vp) {
  66. // Batch send
  67. uint16_t data[DGUS_FILE_COUNT];
  68. for (int i = 0; i < DGUS_FILE_COUNT; i++) {
  69. if (!dgus_screen_handler.filelist.seek(dgus_screen_handler.filelist_offset + i)) {
  70. data[i] = Swap16((uint16_t)DGUS_Data::SDType::NONE);
  71. SetFileControlState(i, false);
  72. continue;
  73. }
  74. data[i] = dgus_screen_handler.filelist.isDir() ?
  75. Swap16((uint16_t)DGUS_Data::SDType::DIRECTORY)
  76. : Swap16((uint16_t)DGUS_Data::SDType::FILE);
  77. SetFileControlState(i, true);
  78. }
  79. dgus_display.Write((uint16_t)vp.addr, data, sizeof(*data) * DGUS_FILE_COUNT);
  80. }
  81. void DGUSTxHandler::FileName(DGUS_VP &vp) {
  82. uint8_t offset;
  83. switch (vp.addr) {
  84. default: return;
  85. case DGUS_Addr::SD_FileName0:
  86. offset = 0;
  87. break;
  88. case DGUS_Addr::SD_FileName1:
  89. offset = 1;
  90. break;
  91. case DGUS_Addr::SD_FileName2:
  92. offset = 2;
  93. break;
  94. case DGUS_Addr::SD_FileName3:
  95. offset = 3;
  96. break;
  97. case DGUS_Addr::SD_FileName4:
  98. offset = 4;
  99. break;
  100. }
  101. if (dgus_screen_handler.filelist.seek(dgus_screen_handler.filelist_offset + offset)) {
  102. dgus_display.WriteString((uint16_t)vp.addr, dgus_screen_handler.filelist.filename(), vp.size);
  103. }
  104. else {
  105. dgus_display.WriteStringPGM((uint16_t)vp.addr, NUL_STR, vp.size);
  106. }
  107. }
  108. void DGUSTxHandler::ScrollIcons(DGUS_VP &vp) {
  109. uint16_t icons = 0;
  110. if (!dgus_screen_handler.filelist.isAtRootDir()) {
  111. icons |= (uint16_t)DGUS_Data::ScrollIcon::GO_BACK;
  112. dgus_display.EnableControl(DGUS_Screen::PRINT,
  113. DGUSDisplay::RETURN_KEY_CODE,
  114. DGUS_Control::GO_BACK);
  115. }
  116. else {
  117. dgus_display.DisableControl(DGUS_Screen::PRINT,
  118. DGUSDisplay::RETURN_KEY_CODE,
  119. DGUS_Control::GO_BACK);
  120. }
  121. if (dgus_screen_handler.filelist_offset > 0) {
  122. icons |= (uint16_t)DGUS_Data::ScrollIcon::UP;
  123. dgus_display.EnableControl(DGUS_Screen::PRINT,
  124. DGUSDisplay::RETURN_KEY_CODE,
  125. DGUS_Control::SCROLL_UP);
  126. }
  127. else {
  128. dgus_display.DisableControl(DGUS_Screen::PRINT,
  129. DGUSDisplay::RETURN_KEY_CODE,
  130. DGUS_Control::SCROLL_UP);
  131. }
  132. if (dgus_screen_handler.filelist_offset + DGUS_FILE_COUNT < dgus_screen_handler.filelist.count()) {
  133. icons |= (uint16_t)DGUS_Data::ScrollIcon::DOWN;
  134. dgus_display.EnableControl(DGUS_Screen::PRINT,
  135. DGUSDisplay::RETURN_KEY_CODE,
  136. DGUS_Control::SCROLL_DOWN);
  137. }
  138. else {
  139. dgus_display.DisableControl(DGUS_Screen::PRINT,
  140. DGUSDisplay::RETURN_KEY_CODE,
  141. DGUS_Control::SCROLL_DOWN);
  142. }
  143. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  144. }
  145. void DGUSTxHandler::SelectedFileName(DGUS_VP &vp) {
  146. if (dgus_screen_handler.filelist_selected < 0
  147. || !dgus_screen_handler.filelist.seek(dgus_screen_handler.filelist_selected)) {
  148. dgus_display.WriteStringPGM((uint16_t)vp.addr, NUL_STR, vp.size);
  149. return;
  150. }
  151. dgus_display.WriteString((uint16_t)vp.addr, dgus_screen_handler.filelist.filename(), vp.size);
  152. }
  153. #endif // SDSUPPORT
  154. void DGUSTxHandler::PositionZ(DGUS_VP &vp) {
  155. float position = ExtUI::isAxisPositionKnown(ExtUI::Z) ?
  156. planner.get_axis_position_mm(Z_AXIS)
  157. : 0;
  158. const int16_t data = dgus_display.ToFixedPoint<float, int16_t, 1>(position);
  159. dgus_display.Write((uint16_t)vp.addr, Swap16(data));
  160. }
  161. void DGUSTxHandler::Ellapsed(DGUS_VP &vp) {
  162. char buffer[21];
  163. duration_t(print_job_timer.duration()).toString(buffer);
  164. dgus_display.WriteString((uint16_t)vp.addr, buffer, vp.size);
  165. }
  166. void DGUSTxHandler::Percent(DGUS_VP &vp) {
  167. uint16_t progress;
  168. switch (vp.addr) {
  169. default: return;
  170. case DGUS_Addr::STATUS_Percent:
  171. progress = constrain(ExtUI::getProgress_percent(), 0, 100);
  172. break;
  173. case DGUS_Addr::STATUS_Percent_Complete:
  174. progress = 100;
  175. break;
  176. }
  177. dgus_display.Write((uint16_t)DGUS_Addr::STATUS_Percent, Swap16(progress));
  178. }
  179. void DGUSTxHandler::StatusIcons(DGUS_VP &vp) {
  180. uint16_t icons = 0;
  181. if (ExtUI::isPrinting()) {
  182. icons |= (uint16_t)DGUS_Data::StatusIcon::PAUSE;
  183. dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
  184. DGUSDisplay::POPUP_WINDOW,
  185. DGUS_Control::PAUSE);
  186. }
  187. else {
  188. dgus_display.DisableControl(DGUS_Screen::PRINT_STATUS,
  189. DGUSDisplay::POPUP_WINDOW,
  190. DGUS_Control::PAUSE);
  191. }
  192. if (ExtUI::isPrintingPaused()) {
  193. icons |= (uint16_t)DGUS_Data::StatusIcon::RESUME;
  194. dgus_display.EnableControl(DGUS_Screen::PRINT_STATUS,
  195. DGUSDisplay::POPUP_WINDOW,
  196. DGUS_Control::RESUME);
  197. }
  198. else {
  199. dgus_display.DisableControl(DGUS_Screen::PRINT_STATUS,
  200. DGUSDisplay::POPUP_WINDOW,
  201. DGUS_Control::RESUME);
  202. }
  203. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  204. }
  205. void DGUSTxHandler::Flowrate(DGUS_VP &vp) {
  206. int16_t flowrate;
  207. switch (vp.addr) {
  208. default: return;
  209. case DGUS_Addr::ADJUST_Flowrate_CUR:
  210. flowrate = ExtUI::getFlow_percent(TERN(HAS_MULTI_EXTRUDER, ExtUI::getActiveTool(), ExtUI::E0));
  211. break;
  212. #if HAS_MULTI_EXTRUDER
  213. case DGUS_Addr::ADJUST_Flowrate_E0:
  214. flowrate = ExtUI::getFlow_percent(ExtUI::E0);
  215. break;
  216. case DGUS_Addr::ADJUST_Flowrate_E1:
  217. flowrate = ExtUI::getFlow_percent(ExtUI::E1);
  218. break;
  219. #endif
  220. }
  221. dgus_display.Write((uint16_t)vp.addr, Swap16(flowrate));
  222. }
  223. void DGUSTxHandler::TempMax(DGUS_VP &vp) {
  224. uint16_t temp;
  225. switch (vp.addr) {
  226. default: return;
  227. case DGUS_Addr::TEMP_Max_Bed:
  228. temp = BED_MAX_TARGET;
  229. break;
  230. case DGUS_Addr::TEMP_Max_H0:
  231. temp = HEATER_0_MAXTEMP - HOTEND_OVERSHOOT;
  232. break;
  233. #if HAS_MULTI_HOTEND
  234. case DGUS_Addr::TEMP_Max_H1:
  235. temp = HEATER_1_MAXTEMP - HOTEND_OVERSHOOT;
  236. break;
  237. #endif
  238. }
  239. dgus_display.Write((uint16_t)vp.addr, Swap16(temp));
  240. }
  241. void DGUSTxHandler::StepperStatus(DGUS_VP &vp) {
  242. const bool motor_on = stepper.axis_enabled.bits & (_BV(NUM_AXES) - 1);
  243. dgus_display.Write((uint16_t)vp.addr, Swap16(uint16_t(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED)));
  244. }
  245. void DGUSTxHandler::StepIcons(DGUS_VP &vp) {
  246. if (!vp.extra) return;
  247. uint16_t icons = 0;
  248. DGUS_Data::StepSize size = *(DGUS_Data::StepSize*)vp.extra;
  249. switch (size) {
  250. case DGUS_Data::StepSize::MM10:
  251. icons |= (uint16_t)DGUS_Data::StepIcon::MM10;
  252. break;
  253. case DGUS_Data::StepSize::MM1:
  254. icons |= (uint16_t)DGUS_Data::StepIcon::MM1;
  255. break;
  256. case DGUS_Data::StepSize::MMP1:
  257. icons |= (uint16_t)DGUS_Data::StepIcon::MMP1;
  258. break;
  259. case DGUS_Data::StepSize::MMP01:
  260. icons |= (uint16_t)DGUS_Data::StepIcon::MMP01;
  261. break;
  262. }
  263. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  264. }
  265. void DGUSTxHandler::ABLDisableIcon(DGUS_VP &vp) {
  266. uint16_t data;
  267. if (ExtUI::getLevelingActive()) {
  268. data = (uint16_t)DGUS_Data::Status::ENABLED;
  269. dgus_display.EnableControl(DGUS_Screen::LEVELING_AUTOMATIC,
  270. DGUSDisplay::RETURN_KEY_CODE,
  271. DGUS_Control::DISABLE);
  272. }
  273. else {
  274. data = (uint16_t)DGUS_Data::Status::DISABLED;
  275. dgus_display.DisableControl(DGUS_Screen::LEVELING_AUTOMATIC,
  276. DGUSDisplay::RETURN_KEY_CODE,
  277. DGUS_Control::DISABLE);
  278. }
  279. dgus_display.Write((uint16_t)vp.addr, Swap16(data));
  280. }
  281. void DGUSTxHandler::ABLGrid(DGUS_VP &vp) {
  282. // Batch send
  283. int16_t data[DGUS_LEVEL_GRID_SIZE];
  284. xy_uint8_t point;
  285. int16_t fixed;
  286. for (int i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) {
  287. point.x = i % GRID_MAX_POINTS_X;
  288. point.y = i / GRID_MAX_POINTS_X;
  289. fixed = dgus_display.ToFixedPoint<float, int16_t, 3>(ExtUI::getMeshPoint(point));
  290. data[i] = Swap16(fixed);
  291. }
  292. dgus_display.Write((uint16_t)vp.addr, data, sizeof(*data) * DGUS_LEVEL_GRID_SIZE);
  293. }
  294. void DGUSTxHandler::FilamentIcons(DGUS_VP &vp) {
  295. uint16_t icons = 0;
  296. switch (dgus_screen_handler.filament_extruder) {
  297. default: return;
  298. case DGUS_Data::Extruder::CURRENT:
  299. #if HAS_MULTI_EXTRUDER
  300. switch (ExtUI::getActiveTool()) {
  301. default: break;
  302. case ExtUI::E0:
  303. icons |= (uint16_t)DGUS_Data::ExtruderIcon::E0;
  304. break;
  305. case ExtUI::E1:
  306. icons |= (uint16_t)DGUS_Data::ExtruderIcon::E1;
  307. break;
  308. }
  309. break;
  310. #endif
  311. case DGUS_Data::Extruder::E0:
  312. icons |= (uint16_t)DGUS_Data::ExtruderIcon::E0;
  313. break;
  314. case DGUS_Data::Extruder::E1:
  315. icons |= (uint16_t)DGUS_Data::ExtruderIcon::E1;
  316. break;
  317. }
  318. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  319. }
  320. void DGUSTxHandler::BLTouch(DGUS_VP &vp) {
  321. #if ENABLED(BLTOUCH)
  322. dgus_display.EnableControl(DGUS_Screen::SETTINGS_MENU2,
  323. DGUSDisplay::RETURN_KEY_CODE,
  324. DGUS_Control::EXTRA2);
  325. dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::ENABLED));
  326. #else
  327. dgus_display.DisableControl(DGUS_Screen::SETTINGS_MENU2,
  328. DGUSDisplay::RETURN_KEY_CODE,
  329. DGUS_Control::EXTRA2);
  330. dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::DISABLED));
  331. #endif
  332. }
  333. void DGUSTxHandler::PIDIcons(DGUS_VP &vp) {
  334. uint16_t icons = 0;
  335. switch (dgus_screen_handler.pid_heater) {
  336. default: return;
  337. case DGUS_Data::Heater::BED:
  338. icons |= (uint16_t)DGUS_Data::HeaterIcon::BED;
  339. break;
  340. case DGUS_Data::Heater::H0:
  341. icons |= (uint16_t)DGUS_Data::HeaterIcon::H0;
  342. break;
  343. case DGUS_Data::Heater::H1:
  344. icons |= (uint16_t)DGUS_Data::HeaterIcon::H1;
  345. break;
  346. }
  347. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  348. }
  349. void DGUSTxHandler::PIDKp(DGUS_VP &vp) {
  350. float value;
  351. switch (dgus_screen_handler.pid_heater) {
  352. default: return;
  353. #if ENABLED(PIDTEMPBED)
  354. case DGUS_Data::Heater::BED:
  355. value = ExtUI::getBedPIDValues_Kp();
  356. break;
  357. #endif
  358. #if ENABLED(PIDTEMP)
  359. case DGUS_Data::Heater::H0:
  360. value = ExtUI::getPIDValues_Kp(ExtUI::E0);
  361. break;
  362. #if HAS_MULTI_HOTEND
  363. case DGUS_Data::Heater::H1:
  364. value = ExtUI::getPIDValues_Kp(ExtUI::E1);
  365. break;
  366. #endif
  367. #endif
  368. }
  369. const int32_t data = dgus_display.ToFixedPoint<float, int32_t, 2>(value);
  370. dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
  371. }
  372. void DGUSTxHandler::PIDKi(DGUS_VP &vp) {
  373. float value;
  374. switch (dgus_screen_handler.pid_heater) {
  375. default: return;
  376. #if ENABLED(PIDTEMPBED)
  377. case DGUS_Data::Heater::BED:
  378. value = ExtUI::getBedPIDValues_Ki();
  379. break;
  380. #endif
  381. #if ENABLED(PIDTEMP)
  382. case DGUS_Data::Heater::H0:
  383. value = ExtUI::getPIDValues_Ki(ExtUI::E0);
  384. break;
  385. #if HAS_MULTI_HOTEND
  386. case DGUS_Data::Heater::H1:
  387. value = ExtUI::getPIDValues_Ki(ExtUI::E1);
  388. break;
  389. #endif
  390. #endif
  391. }
  392. const int32_t data = dgus_display.ToFixedPoint<float, int32_t, 2>(value);
  393. dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
  394. }
  395. void DGUSTxHandler::PIDKd(DGUS_VP &vp) {
  396. float value;
  397. switch (dgus_screen_handler.pid_heater) {
  398. default: return;
  399. #if ENABLED(PIDTEMPBED)
  400. case DGUS_Data::Heater::BED:
  401. value = ExtUI::getBedPIDValues_Kd();
  402. break;
  403. #endif
  404. #if ENABLED(PIDTEMP)
  405. case DGUS_Data::Heater::H0:
  406. value = ExtUI::getPIDValues_Kd(ExtUI::E0);
  407. break;
  408. #if HAS_MULTI_HOTEND
  409. case DGUS_Data::Heater::H1:
  410. value = ExtUI::getPIDValues_Kd(ExtUI::E1);
  411. break;
  412. #endif
  413. #endif
  414. }
  415. const int32_t data = dgus_display.ToFixedPoint<float, int32_t, 2>(value);
  416. dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
  417. }
  418. void DGUSTxHandler::BuildVolume(DGUS_VP &vp) {
  419. char buffer[vp.size];
  420. snprintf_P(buffer, vp.size, PSTR("%dx%dx%d"), X_BED_SIZE, Y_BED_SIZE, (Z_MAX_POS - Z_MIN_POS));
  421. dgus_display.WriteString((uint16_t)vp.addr, buffer, vp.size);
  422. }
  423. void DGUSTxHandler::TotalPrints(DGUS_VP &vp) {
  424. #if ENABLED(PRINTCOUNTER)
  425. dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(print_job_timer.getStats().totalPrints));
  426. #else
  427. UNUSED(vp);
  428. #endif
  429. }
  430. void DGUSTxHandler::FinishedPrints(DGUS_VP &vp) {
  431. #if ENABLED(PRINTCOUNTER)
  432. dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(print_job_timer.getStats().finishedPrints));
  433. #else
  434. UNUSED(vp);
  435. #endif
  436. }
  437. void DGUSTxHandler::PrintTime(DGUS_VP &vp) {
  438. #if ENABLED(PRINTCOUNTER)
  439. char buffer[21];
  440. ExtUI::getTotalPrintTime_str(buffer);
  441. dgus_display.WriteString((uint16_t)vp.addr, buffer, vp.size);
  442. #else
  443. dgus_display.WriteStringPGM((uint16_t)vp.addr, DGUS_MSG_UNDEF, vp.size);
  444. #endif
  445. }
  446. void DGUSTxHandler::LongestPrint(DGUS_VP &vp) {
  447. #if ENABLED(PRINTCOUNTER)
  448. char buffer[21];
  449. ExtUI::getLongestPrint_str(buffer);
  450. dgus_display.WriteString((uint16_t)vp.addr, buffer, vp.size);
  451. #else
  452. dgus_display.WriteStringPGM((uint16_t)vp.addr, DGUS_MSG_UNDEF, vp.size);
  453. #endif
  454. }
  455. void DGUSTxHandler::FilamentUsed(DGUS_VP &vp) {
  456. #if ENABLED(PRINTCOUNTER)
  457. char buffer[21];
  458. ExtUI::getFilamentUsed_str(buffer);
  459. dgus_display.WriteString((uint16_t)vp.addr, buffer, vp.size);
  460. #else
  461. dgus_display.WriteStringPGM((uint16_t)vp.addr, DGUS_MSG_UNDEF, vp.size);
  462. #endif
  463. }
  464. void DGUSTxHandler::WaitIcons(DGUS_VP &vp) {
  465. uint16_t icons = 0;
  466. if (ExtUI::isPrintingPaused()) {
  467. icons |= (uint16_t)DGUS_Data::WaitIcon::ABORT;
  468. dgus_display.EnableControl(DGUS_Screen::WAIT,
  469. DGUSDisplay::POPUP_WINDOW,
  470. DGUS_Control::ABORT);
  471. }
  472. else {
  473. dgus_display.DisableControl(DGUS_Screen::WAIT,
  474. DGUSDisplay::POPUP_WINDOW,
  475. DGUS_Control::ABORT);
  476. }
  477. if (dgus_screen_handler.wait_continue) {
  478. icons |= (uint16_t)DGUS_Data::WaitIcon::CONTINUE;
  479. dgus_display.EnableControl(DGUS_Screen::WAIT,
  480. DGUSDisplay::RETURN_KEY_CODE,
  481. DGUS_Control::CONTINUE);
  482. }
  483. else {
  484. dgus_display.DisableControl(DGUS_Screen::WAIT,
  485. DGUSDisplay::RETURN_KEY_CODE,
  486. DGUS_Control::CONTINUE);
  487. }
  488. dgus_display.Write((uint16_t)vp.addr, Swap16(icons));
  489. }
  490. void DGUSTxHandler::FanSpeed(DGUS_VP &vp) {
  491. uint16_t fan_speed;
  492. switch (vp.addr) {
  493. default: return;
  494. case DGUS_Addr::FAN0_Speed: fan_speed = ExtUI::getTargetFan_percent(ExtUI::FAN0); break;
  495. }
  496. dgus_display.Write((uint16_t)vp.addr, Swap16(fan_speed));
  497. }
  498. void DGUSTxHandler::Volume(DGUS_VP &vp) {
  499. const uint16_t volume = dgus_display.GetVolume();
  500. dgus_display.Write((uint16_t)vp.addr, Swap16(volume));
  501. }
  502. void DGUSTxHandler::Brightness(DGUS_VP &vp) {
  503. const uint16_t brightness = dgus_display.GetBrightness();
  504. dgus_display.Write((uint16_t)vp.addr, Swap16(brightness));
  505. }
  506. void DGUSTxHandler::ExtraToString(DGUS_VP &vp) {
  507. if (!vp.size || !vp.extra) return;
  508. dgus_display.WriteString((uint16_t)vp.addr, vp.extra, vp.size, true, false, false);
  509. }
  510. void DGUSTxHandler::ExtraPGMToString(DGUS_VP &vp) {
  511. if (!vp.size || !vp.extra) return;
  512. dgus_display.WriteStringPGM((uint16_t)vp.addr, vp.extra, vp.size, true, false, false);
  513. }
  514. #endif // DGUS_LCD_UI_RELOADED