comparison Discovery/Src/ostc.c @ 885:8d3f3a635397 Evo_2_23

Replaced global hardwareDisplay with unit access: The previous global hardwaredisplay, which indicated the display version, is stored in scope of ostc.c with interface function access.
author Ideenmodellierer
date Sun, 01 Sep 2024 21:35:50 +0200
parents fe955104901c
children
comparison
equal deleted inserted replaced
884:940f8e132638 885:8d3f3a635397
51 /* Private types -------------------------------------------------------------*/ 51 /* Private types -------------------------------------------------------------*/
52 52
53 /* Private variables ---------------------------------------------------------*/ 53 /* Private variables ---------------------------------------------------------*/
54 54
55 /* Private variables with external access via get_xxx() function -------------*/ 55 /* Private variables with external access via get_xxx() function -------------*/
56 56 static uint8_t hardwareDisplay = 0; //< either OSTC4 LCD (=0) or new Screen (=1)
57 /* Private function prototypes -----------------------------------------------*/ 57 /* Private function prototypes -----------------------------------------------*/
58 58
59 /* Exported functions --------------------------------------------------------*/ 59 /* Exported functions --------------------------------------------------------*/
60 60
61 /** SPI init function 61 /** SPI init function
420 420
421 GPIO_InitStruct.Mode = GPIO_MODE_INPUT; 421 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
422 HAL_GPIO_Init(RESET_LOGIC_ALLES_OK_GPIO_PORT, &GPIO_InitStruct); 422 HAL_GPIO_Init(RESET_LOGIC_ALLES_OK_GPIO_PORT, &GPIO_InitStruct);
423 #endif 423 #endif
424 } 424 }
425 425 void SetDisplayVersion(uint8_t version)
426 {
427 if(version < 2)
428 {
429 hardwareDisplay = version;
430 }
431 }
432 uint8_t isNewDisplay()
433 {
434 uint8_t ret = 0;
435 if(hardwareDisplay == DISPLAY_VERSION_NEW)
436 {
437 ret = 1;
438 }
439 return ret;
440 }
426 441
427 #ifndef BOOTLOADER_STANDALONE 442 #ifndef BOOTLOADER_STANDALONE
428 void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) 443 void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
429 { 444 {
430 if(huart == &UartIR_HUD_Handle) 445 if(huart == &UartIR_HUD_Handle)