mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 00:29:33 +00:00
* Refactor clock delays and improve JTAG runtest timing logic * Refactor time calculations to use CH_FREQUENCY for consistency across modules * Improve delay mechanism for reference oscillator startup in portapack_tcxo_enable * comment * increasing the time * copilot
This commit is contained in:
@@ -59,7 +59,7 @@ void DfuMenu::paint(Painter& painter) {
|
||||
text_info_line_7.set(to_string_dec_uint(shared_memory.m4_stack_usage, 6));
|
||||
text_info_line_8.set(to_string_dec_uint(shared_memory.m4_performance_counter, 6));
|
||||
text_info_line_9.set(to_string_dec_uint(shared_memory.m4_buffer_missed, 6));
|
||||
text_info_line_10.set(to_string_dec_uint(chTimeNow() / 1000, 6));
|
||||
text_info_line_10.set(to_string_dec_uint(chTimeNow() / CH_FREQUENCY, 6));
|
||||
|
||||
constexpr auto margin = 5;
|
||||
|
||||
|
||||
@@ -1012,10 +1012,17 @@ void SetTouchscreenThresholdView::focus() {
|
||||
|
||||
void SetTouchscreenThresholdView::on_frame_sync() {
|
||||
if (!in_auto_detect) return;
|
||||
|
||||
uint32_t time_now = chTimeNow();
|
||||
int32_t time_diff = time_now - time_start_auto_detect;
|
||||
text_wait_timer.set("ETA " + to_string_dec_uint((10 - time_diff / 1000) <= 0 ? 0 : 10 - time_diff / 1000) + "s");
|
||||
if (time_diff >= 10001 && !auto_detect_succeed_consumed) { // 10s
|
||||
|
||||
// Calculate elapsed seconds using CH_FREQUENCY
|
||||
uint32_t elapsed_seconds = time_diff / CH_FREQUENCY;
|
||||
int32_t remaining_seconds = 10 - (int32_t)elapsed_seconds;
|
||||
if (remaining_seconds < 0) remaining_seconds = 0;
|
||||
|
||||
text_wait_timer.set("ETA " + to_string_dec_uint(remaining_seconds) + "s");
|
||||
if (elapsed_seconds >= 10 && !auto_detect_succeed_consumed) { // 10s
|
||||
in_auto_detect = false;
|
||||
text_wait_timer.hidden(true);
|
||||
text_hint.set("OK, press save and reboot");
|
||||
|
||||
Reference in New Issue
Block a user