Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration #1

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

giuuuug
Copy link

@giuuuug giuuuug commented Dec 5, 2024

No description provided.

.gitmodules Outdated Show resolved Hide resolved
Core/Inc/main.h Outdated Show resolved Hide resolved
Core/Inc/main.h Outdated Show resolved Hide resolved
Core/Src/main.c Outdated Show resolved Hide resolved
Core/Src/main.c Outdated Show resolved Hide resolved
Core/Src/dashboard.c Show resolved Hide resolved
Lib/LVGL9/callback/callback.c Outdated Show resolved Hide resolved
Lib/LVGL9/callback/callback.c Outdated Show resolved Hide resolved
Lib/LVGL9/log/log.c Outdated Show resolved Hide resolved
Lib/LVGL9/log/log.h Outdated Show resolved Hide resolved
Lib/LVGL9/callback/callback.c Outdated Show resolved Hide resolved
Lib/LVGL9/callback/callback.h Outdated Show resolved Hide resolved
Lib/LVGL9/callback/callback.h Outdated Show resolved Hide resolved
@simoneruffini
Copy link
Member

I'm not convinced on how you are structuring the lvgl folder inside lib. Here my notes:

  1. I understand the double nesting lib/LVGL9/lvgl because in this way you know where to put the lvgl_conf.h file. Good job! I don't really like the fact that you put the version (LVGL9) as the folder name because in the future if you migrate to a new version this folder will need to be renamed -> refactor the makefile, etc... (and probably no one will ever do this). So maybe you can think of a better name.
  2. You are adding additional code to LVGL and you are using a pattern of creating new folders for each feature ( callback/ and log/). I suggest you avoiding this if there is no particular necessity. You created 4 new files that contain less then 200 lines of code if you sum them up. You could just add a single source pair in the same place where you have log_conf.h, e.g. lvgl_user_code.h/c, lvgl_utils.h/c, lvgl_extra.h/c, choose a name that fits. This is a personal preference because I don't like creating files in projects because as a new user it gets overwhelming and messes with your head. I like the approach of having less files with more stuff in it (e.g. bsp.c/h)

dashboard.ioc Outdated Show resolved Hide resolved
.gitmodules Outdated Show resolved Hide resolved
@@ -1,22 +1,25 @@
/*INCLUDES*/

#include "bsp.h"
#include "ili9488.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future improvements of the code you should end up in a state where the file that contains the control code doesn't depend on level drivers, i.e. you will lose the #include "ili9488.h dependency in dashboard.c because all the code you will need is in either LVGL stuff or bsp.h.

You can close this comment, just keep in mind it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enable the watchdog, otherwise you will forget it!

Comment on lines +16 to 17
#define ON 1
#define OFF 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do you use this defines?

Comment on lines +488 to +493
enum LCD_TFT_Device{CS, RST, DC, LCD_TFT_Device_NUM};
static const struct GPIO_Tuple LCD_TFT_Device_to_GPIO_Tuple_map[LCD_TFT_Device_NUM] = {
[CS] = {.GPIO_Port = LCD_TFT_CS_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_CS_GPIO_OUT_Pin},
[DC] = {.GPIO_Port = LCD_TFT_DC_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_DC_GPIO_OUT_Pin},
[RST] = {.GPIO_Port = LCD_TFT_RST_GPIO_OUT_GPIO_Port, .GPIO_Pin = LCD_TFT_RST_GPIO_OUT_Pin},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This construct here is used improperly: the array-map construct is used to make dictionaries/maps of similar things (for example LED_MONO). These GPIOs are related to one another because they are necessary to drive the LCD_TFT display but they have different functions hence they are not a LCD_TFT device. In this case I suggest you to use a struct (a handle) to group everything since it betters conveys the fact that you are making a sort of "class" for the LCD_TFT. If you will end up using the code I pushed on ili9488 this is already available with the struct ILI9488_Handle.

Core/Src/dashboard.c Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix/namespace

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix/namespace missing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix/namespace missing on exported functions (eg: GUI, UI, EEZ_UI ...)
IMHO create is a bit cringe as a name in a fuction

mem_mon.used_pct,
(unsigned long)mem_mon.free_biggest_size);

HAL_UART_Transmit(&LCD_TFT_USART_Handle, (uint8_t *)buffer, strlen(buffer), HAL_MAX_DELAY);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should move to an interrupt based approach with DMA in the future otherwise when you do loggin the application will run veeeeery slowly.

Comment on lines +24 to +25
#define BYTES_PER_PIXEL (LV_COLOR_FORMAT_GET_SIZE(LV_COLOR_FORMAT_RGB888))
#define BUFFER_SIZE (VERTICAL_RES * HORIZONTAL_RES * BYTES_PER_PIXEL / 7)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace/prefix

Comment on lines 5 to 7
[submodule "Lib/PCA9555"]
path = Lib/PCA9555
url = https://github.com/squadracorsepolito/PCA9555.git
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants