From cab9388f4cdffdd622b52a77467d65a5839a6f8d Mon Sep 17 00:00:00 2001 From: Mysteo91 Date: Fri, 6 Sep 2024 10:23:36 +0300 Subject: [PATCH] --upd --- App/app.cpp | 11 +++++++---- CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/App/app.cpp b/App/app.cpp index fed05b1..db25989 100644 --- a/App/app.cpp +++ b/App/app.cpp @@ -95,6 +95,9 @@ void zummerOff(void) { void zummerOn(void) { HAL_TIM_Base_Start(&htimZummer); HAL_TIM_PWM_Start(&htimZummer, TIM_CHANNEL_2); +#ifndef PASSIVE_ZUMMER + __HAL_TIM_SET_COMPARE(&htimZummer, TIM_CHANNEL_2, __HAL_TIM_GET_AUTORELOAD(&htimZummer) - 1); +#endif } void lightingOn(void) { @@ -144,8 +147,8 @@ uint8_t uartTask(void) // return 0 if data received , otherwise return 1 stringView.copy(reinterpret_cast(uart1Buf), size, 0); if (size == sizeof(command_t)) { - uint8_t com = stringView[0]; - if (com == ENTER_FIRMWARE_UPDATE) { + uint8_t command = stringView[0]; + if (command == ENTER_FIRMWARE_UPDATE) { HAL_UART_Transmit_IT(bridge.getHuart1(), (uint8_t*) &uart1Buf[0], sizeof(sendCommand)); HAL_Delay(200); HAL_UART_DeInit(bridge.getHuart1()); @@ -155,10 +158,10 @@ uint8_t uartTask(void) // return 0 if data received , otherwise return 1 updateMode = 1; bootStartMs = HAL_GetTick(); - } else if (com == ZUMMER_ON || com == ZUMMER_OFF) { + } else if (command == ZUMMER_ON || command == ZUMMER_OFF) { memcpy(&lastZummerCommand, uart1Buf, sizeof(lastZummerCommand)); } - else if (com == GET_FIRMWARE_VERSION) + else if (command == GET_FIRMWARE_VERSION) { uint8_t fw_ver[16]; sprintf(reinterpret_cast(fw_ver),"%s", FW_VERSION); diff --git a/CMakeLists.txt b/CMakeLists.txt index a385ee2..42f2134 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ else() set(COMPILE_DEF USE_HAL_DRIVER USE_FULL_LL_DRIVER - ${ENV_MCU} + ${MCU} #//////////////////////////USER DEFINITIONS MBEDTLS_CONFIG_FILE="mbedtls_config.h" #/////////////////////////////////////////