diff --git a/docs/lcd_api.md b/docs/lcd_api.md index 58b2692..4e61aca 100644 --- a/docs/lcd_api.md +++ b/docs/lcd_api.md @@ -116,7 +116,7 @@ Note that when an image exceeds the X or Y size of the LCD display, the image wi #### Drawing a BMP from the filesystem to the LCD ```c -void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos); +void lcd_draw_img_from_fs(const char* name, uint32_t x_pos, uint32_t y_pos); ``` ```c @@ -126,7 +126,7 @@ void main(void) { ... lcd_init(true); ... - lcd_draw_img_from_fs_with_name("st.bmp", 0, 0); + lcd_draw_img_from_fs("st.bmp", 0, 0); } ``` diff --git a/project/Core/Inc/lcd_api.h b/project/Core/Inc/lcd_api.h index bf37e9d..02715f5 100644 --- a/project/Core/Inc/lcd_api.h +++ b/project/Core/Inc/lcd_api.h @@ -116,7 +116,7 @@ void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos); * @param[in] x_pos X-position * @param[in] y_pos Y-position */ -void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos); +void lcd_draw_img_from_fs(const char* name, uint32_t x_pos, uint32_t y_pos); /** * @brief Clear LCD screen diff --git a/project/Core/Src/lcd_api.c b/project/Core/Src/lcd_api.c index 9608462..446fd05 100644 --- a/project/Core/Src/lcd_api.c +++ b/project/Core/Src/lcd_api.c @@ -96,19 +96,19 @@ void lcd_draw_raw_img(const void* p_src, uint32_t x_pos, uint32_t y_pos, uint32_ HAL_DMA2D_PollForTransfer(&hDma2dHandler2, 10); } -void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos){ +void lcd_draw_bmp_img(uint8_t* bmp_buff, uint32_t x_pos, uint32_t y_pos) { BSP_LCD_DrawBitmap(x_pos, y_pos, bmp_buff); } -void lcd_draw_img_from_fs_with_name(const char* name, uint32_t x_pos, uint32_t y_pos){ +void lcd_draw_img_from_fs(const char* name, uint32_t x_pos, uint32_t y_pos) { llfs_file_t* file = llfs_file_open(name); if (file != NULL) { BSP_LCD_DrawBitmap(x_pos, y_pos, file->data); - } else { - LOG_WARN(TAG, "File \"%s\" not found", file->name); + return; } + LOG_WARN(TAG, "File \"%s\" not found", file->name); } -void lcd_clear(uint32_t color){ +void lcd_clear(uint32_t color) { BSP_LCD_Clear(color); }