diff --git a/Firmware/Core/Inc/main.h b/Firmware/Core/Inc/main.h index 6a08bbc..ee62afd 100644 --- a/Firmware/Core/Inc/main.h +++ b/Firmware/Core/Inc/main.h @@ -71,6 +71,9 @@ void Error_Handler(void); #define KEY2_Pin GPIO_PIN_1 #define KEY2_GPIO_Port GPIOA #define KEY2_EXTI_IRQn EXTI1_IRQn +#define SENOR_Pin GPIO_PIN_3 +#define SENOR_GPIO_Port GPIOA +#define SENOR_EXTI_IRQn EXTI3_IRQn #define KEY3_Pin GPIO_PIN_4 #define KEY3_GPIO_Port GPIOA #define KEY3_EXTI_IRQn EXTI4_IRQn diff --git a/Firmware/Core/Src/main.c b/Firmware/Core/Src/main.c index 17ef85a..916884b 100644 --- a/Firmware/Core/Src/main.c +++ b/Firmware/Core/Src/main.c @@ -111,15 +111,26 @@ int main(void) WS_TFT_Init(); HAL_UARTEx_ReceiveToIdle_DMA(&huart1,cmdBuffer, sizeof(cmdBuffer)); __HAL_DMA_DISABLE_IT(&hdma_usart1_rx,DMA_IT_HT); + printf("System Init OK!\r\n"); Staring_Menu(); taxiSystemInit(); + uint8_t menuFlag = 0; /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { - user_Menu(); + + if(keyVal == 2 && (getChangeFlag() == 0)){ + menuFlag++; + WS_TFT_Clear(WHITE); + keyVal = 0; + } + if(menuFlag == 0) user_Menu(); + else if(menuFlag == 1) changePriceMenu(); + else menuFlag = 0; + /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */