Addhere to some missed style guidlines

This commit is contained in:
xoreo
2023-11-14 15:51:27 +01:00
parent a899fdaee8
commit cb1e227790

View File

@@ -22,11 +22,11 @@ void lcd_init(bool bl_on) {
if (bl_on) { if (bl_on) {
HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOI, GPIO_PIN_12, GPIO_PIN_SET); HAL_GPIO_WritePin(GPIOI, GPIO_PIN_12, GPIO_PIN_SET);
} else { return;
}
HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOK, GPIO_PIN_3, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOI, GPIO_PIN_12, GPIO_PIN_RESET); HAL_GPIO_WritePin(GPIOI, GPIO_PIN_12, GPIO_PIN_RESET);
} }
}
void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font) { void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t color, uint32_t bg_color, sFONT *font) {
LOG_INFO(TAG, "Display text: %s @x=%d,y=%d", text, x_pos, y_pos); LOG_INFO(TAG, "Display text: %s @x=%d,y=%d", text, x_pos, y_pos);
@@ -50,17 +50,16 @@ void lcd_display_text(uint8_t* text, uint16_t x_pos, uint16_t y_pos, uint32_t co
} }
x_pos = 0; x_pos = 0;
y_pos += font->Height; y_pos += font->Height;
} else { continue;
}
BSP_LCD_DisplayChar(x_pos, y_pos, text[i]); BSP_LCD_DisplayChar(x_pos, y_pos, text[i]);
x_pos += font->Width; x_pos += font->Width;
} }
return;
} }
} else {
BSP_LCD_DisplayStringAt(x_pos, y_pos, text, LEFT_MODE); BSP_LCD_DisplayStringAt(x_pos, y_pos, text, LEFT_MODE);
} }
}
void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode) { void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_t x_size, uint32_t y_size, uint32_t color_mode) {
uint32_t address = hLtdcHandler.LayerCfg[1].FBStartAdress + (((BSP_LCD_GetXSize() * y_pos) + x_pos) * (4)); uint32_t address = hLtdcHandler.LayerCfg[1].FBStartAdress + (((BSP_LCD_GetXSize() * y_pos) + x_pos) * (4));