This commit is contained in:
Mysteo91
2024-09-06 10:23:36 +03:00
parent 275752357a
commit cab9388f4c
2 changed files with 8 additions and 5 deletions

View File

@@ -95,6 +95,9 @@ void zummerOff(void) {
void zummerOn(void) { void zummerOn(void) {
HAL_TIM_Base_Start(&htimZummer); HAL_TIM_Base_Start(&htimZummer);
HAL_TIM_PWM_Start(&htimZummer, TIM_CHANNEL_2); 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) { void lightingOn(void) {
@@ -144,8 +147,8 @@ uint8_t uartTask(void) // return 0 if data received , otherwise return 1
stringView.copy(reinterpret_cast<char *>(uart1Buf), size, 0); stringView.copy(reinterpret_cast<char *>(uart1Buf), size, 0);
if (size == sizeof(command_t)) if (size == sizeof(command_t))
{ {
uint8_t com = stringView[0]; uint8_t command = stringView[0];
if (com == ENTER_FIRMWARE_UPDATE) { if (command == ENTER_FIRMWARE_UPDATE) {
HAL_UART_Transmit_IT(bridge.getHuart1(), (uint8_t*) &uart1Buf[0], sizeof(sendCommand)); HAL_UART_Transmit_IT(bridge.getHuart1(), (uint8_t*) &uart1Buf[0], sizeof(sendCommand));
HAL_Delay(200); HAL_Delay(200);
HAL_UART_DeInit(bridge.getHuart1()); HAL_UART_DeInit(bridge.getHuart1());
@@ -155,10 +158,10 @@ uint8_t uartTask(void) // return 0 if data received , otherwise return 1
updateMode = 1; updateMode = 1;
bootStartMs = HAL_GetTick(); bootStartMs = HAL_GetTick();
} else if (com == ZUMMER_ON || com == ZUMMER_OFF) { } else if (command == ZUMMER_ON || command == ZUMMER_OFF) {
memcpy(&lastZummerCommand, uart1Buf, sizeof(lastZummerCommand)); memcpy(&lastZummerCommand, uart1Buf, sizeof(lastZummerCommand));
} }
else if (com == GET_FIRMWARE_VERSION) else if (command == GET_FIRMWARE_VERSION)
{ {
uint8_t fw_ver[16]; uint8_t fw_ver[16];
sprintf(reinterpret_cast<char *>(fw_ver),"%s", FW_VERSION); sprintf(reinterpret_cast<char *>(fw_ver),"%s", FW_VERSION);

View File

@@ -91,7 +91,7 @@ else()
set(COMPILE_DEF set(COMPILE_DEF
USE_HAL_DRIVER USE_HAL_DRIVER
USE_FULL_LL_DRIVER USE_FULL_LL_DRIVER
${ENV_MCU} ${MCU}
#//////////////////////////USER DEFINITIONS #//////////////////////////USER DEFINITIONS
MBEDTLS_CONFIG_FILE="mbedtls_config.h" MBEDTLS_CONFIG_FILE="mbedtls_config.h"
#///////////////////////////////////////// #/////////////////////////////////////////