From 1ea48b2716578cc34c6e719f5232eca5cd123656 Mon Sep 17 00:00:00 2001 From: Roman Belov Date: Sun, 28 Jan 2024 16:35:15 +0300 Subject: [PATCH] Fixes in CAN and GUI front-end. --- phobia/config.c | 2 +- phobia/phobia.c | 8 ++++---- src/hal/can.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phobia/config.c b/phobia/config.c index a836fdb..696c7eb 100644 --- a/phobia/config.c +++ b/phobia/config.c @@ -239,6 +239,6 @@ void config_default(struct config_phobia *fe) strcpy(fe->fuzzy, "setpoint"); - fe->regfile = 475; + fe->regfile = 480; } diff --git a/phobia/phobia.c b/phobia/phobia.c index 446b2dd..841f08b 100644 --- a/phobia/phobia.c +++ b/phobia/phobia.c @@ -2716,7 +2716,7 @@ page_diagnose(struct public *pub) if (link_grab_file_open(lp, pub->debug.file_snap) != 0) { - if (link_command(lp, "ap_log_flush") != 0) { + if (link_command(lp, "ap_log_flush" "\r\n") != 0) { pub->debug.log_flush = 1; } @@ -4073,7 +4073,7 @@ page_lu_flux(struct public *pub) link_command(lp, "pm_probe_noise_threshold"); } - if (nk_menu_item_label(ctx, "ZH threshold self-adjustment", NK_TEXT_LEFT)) { + if (nk_menu_item_label(ctx, "ZONE self-adjustment", NK_TEXT_LEFT)) { link_command(lp, "reg pm.zone_threshold -1"); } @@ -5039,8 +5039,8 @@ page_telemetry(struct public *pub) nk_layout_row_dynamic(ctx, 0, 1); nk_spacer(ctx); - reg_float(pub, "tlm.grabfreq", "Grab into RAM frequency"); - reg_float(pub, "tlm.livefreq", "Live frequency"); + reg_float(pub, "tlm.rate_grab", "Grab into RAM frequency"); + reg_float(pub, "tlm.rate_live", "Live frequency"); nk_layout_row_dynamic(ctx, 0, 1); nk_spacer(ctx); diff --git a/src/hal/can.c b/src/hal/can.c index b21d764..3f18033 100644 --- a/src/hal/can.c +++ b/src/hal/can.c @@ -74,7 +74,7 @@ void CAN_startup() } static int -CAN_wait_for_MSR(uint32_t xBITS, uint32_t xVAL) +CAN_wait_for_MSR(uint32_t xBITS, uint32_t xSET) { uint32_t xMSR; int wait_N = 0; @@ -82,7 +82,7 @@ CAN_wait_for_MSR(uint32_t xBITS, uint32_t xVAL) do { xMSR = CAN1->MSR & xBITS; - if (xMSR == xVAL) { + if (xMSR == xSET) { return HAL_OK; } @@ -111,7 +111,7 @@ void CAN_configure() * */ CAN1->MCR |= CAN_MCR_INRQ; - if (CAN_wait_for_MSR(CAN_MSR_INAK, CAN_MSR_INAK) == 0) { + if (CAN_wait_for_MSR(CAN_MSR_INAK, CAN_MSR_INAK) != HAL_OK) { log_TRACE("CAN to INIT failed" EOL); } @@ -135,7 +135,7 @@ void CAN_configure() * */ CAN1->MCR &= ~CAN_MCR_INRQ; - if (CAN_wait_for_MSR(CAN_MSR_INAK, CAN_MSR_INAK) == 0) { + if (CAN_wait_for_MSR(CAN_MSR_INAK, CAN_MSR_INAK) != HAL_OK) { log_TRACE("CAN to NORMAL failed" EOL); }