code style

This commit is contained in:
Ken Van Hoeylandt 2023-12-25 13:03:52 +01:00
parent d9a938e9be
commit b0989f73af
5 changed files with 19 additions and 11 deletions

8
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,8 @@
# Note
During the pre-alpha stage, contributions will not yet be considered.
# Code Style
See [github.com/MaJerle/c-code-style](https://github.com/MaJerle/c-code-style).

View File

@ -26,13 +26,13 @@ static SemaphoreHandle_t refresh_finish = NULL;
#define BITS_PER_PIXEL 16
#define DRAW_BUFFER_HEIGHT 80
IRAM_ATTR static bool test_notify_refresh_ready(esp_lcd_panel_io_handle_t io_handle, esp_lcd_panel_io_event_data_t* edata, void* user_ctx) {
IRAM_ATTR static bool prv_on_color_trans_done(esp_lcd_panel_io_handle_t io_handle, esp_lcd_panel_io_event_data_t* edata, void* user_ctx) {
BaseType_t need_yield = pdFALSE;
xSemaphoreGiveFromISR(refresh_finish, &need_yield);
return (need_yield == pdTRUE);
}
static esp_err_t ili9341_create_display(nb_display_t* display) {
static esp_err_t prv_create_display(nb_display_t* display) {
ESP_LOGI(TAG, "init started");
gpio_config_t io_conf = {
@ -59,7 +59,7 @@ static esp_err_t ili9341_create_display(nb_display_t* display) {
const esp_lcd_panel_io_spi_config_t panel_io_config = ILI9341_PANEL_IO_SPI_CONFIG(
PIN_CS,
PIN_DC,
test_notify_refresh_ready,
prv_on_color_trans_done,
NULL
);
@ -117,7 +117,7 @@ static esp_err_t ili9341_create_display(nb_display_t* display) {
nb_display_driver_t board_2432s024_create_display_driver() {
nb_display_driver_t driver = {
.name = "ili9341_2432s024",
.create_display = &ili9341_create_display
.create_display = &prv_create_display
};
return driver;
}

View File

@ -9,7 +9,7 @@
const char* TAG = "cst816";
static esp_err_t cst816_init_io(esp_lcd_panel_io_handle_t* io_handle) {
static esp_err_t prv_init_io(esp_lcd_panel_io_handle_t* io_handle) {
// Init I2C
const i2c_config_t i2c_conf = {
.mode = I2C_MODE_MASTER,
@ -29,7 +29,7 @@ static esp_err_t cst816_init_io(esp_lcd_panel_io_handle_t* io_handle) {
return ESP_OK;
}
static esp_err_t cst816_create_touch(esp_lcd_panel_io_handle_t io_handle, esp_lcd_touch_handle_t* touch_handle) {
static esp_err_t prv_create_touch(esp_lcd_panel_io_handle_t io_handle, esp_lcd_touch_handle_t* touch_handle) {
// Configure touch
esp_lcd_touch_config_t config = {
.x_max = 240,
@ -55,8 +55,8 @@ static esp_err_t cst816_create_touch(esp_lcd_panel_io_handle_t io_handle, esp_lc
nb_touch_driver_t board_2432s024_create_touch_driver() {
nb_touch_driver_t driver = {
.name = "cst816s_2432s024",
.init_io = cst816_init_io,
.create_touch = &cst816_create_touch
.init_io = prv_init_io,
.create_touch = &prv_create_touch
};
return driver;
}

View File

@ -8,7 +8,7 @@
static const char* TAG = "nb_platform";
static esp_err_t prv_nb_lvgl_init(
static esp_err_t prv_lvgl_init(
nb_platform_t* platform
) {
const lvgl_port_cfg_t lvgl_cfg = {
@ -71,7 +71,7 @@ esp_err_t nb_platform_create(nb_platform_config_t config, nb_platform_t* platfor
);
ESP_RETURN_ON_ERROR(
prv_nb_lvgl_init(platform),
prv_lvgl_init(platform),
nbi_tag,
"lvgl init failed"
);

View File

@ -1,8 +1,8 @@
#include <esp_err.h>
#include <esp_log.h>
#include <esp_check.h>
#include <nanobake.h>
// Nanobake board support with drivers:
#include <board_2432s024_touch.h>
#include <board_2432s024_display.h>