Skip to content

Commit 281bd70

Browse files
committed
Fixes build errors
1 parent 638a967 commit 281bd70

File tree

4 files changed

+26
-19
lines changed

4 files changed

+26
-19
lines changed

builder/esp32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def repl_args(extra_args):
252252
esp_args, extra_args = esp_argParser.parse_known_args(extra_args)
253253

254254
enable_uart_repl = esp_args.enable_uart_repl
255-
uart_repl_bitrate = esp_args.enable_uart_repl
255+
uart_repl_bitrate = esp_args.uart_repl_bitrate
256256

257257
if mcu in ('esp32s3', 'esp32s2', 'esp32c3', 'esp32c6'):
258258
enable_cdc_repl = esp_args.enable_cdc_repl
@@ -1254,7 +1254,7 @@ def update_main():
12541254

12551255

12561256
def build_sdkconfig(*args):
1257-
if custom_board_path is None:
1257+
if custom_board_path is not None:
12581258
return
12591259

12601260
base_config = [

ext_mod/spi3wire/include/spi3wire.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
#include "esp_lcd_panel_io_additions.h"
1111
#include "esp_lcd_panel_io.h"
1212

13+
#if CONFIG_LCD_ENABLE_DEBUG_LOG
14+
#define SPI3WIRE_DEBUG_PRINT(...) mp_printf(&mp_plat_print, __VA_ARGS__);
15+
#else
16+
#define SPI3WIRE_DEBUG_PRINT(...)
17+
#endif
1318

1419
typedef struct {
1520
mp_obj_base_t base;

ext_mod/spi3wire/src/esp_lcd_panel_io_3wire_spi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
#include "esp_lcd_panel_io_additions.h"
1717

18+
#define ESP_LCD_PANEL_IO_ADDITIONS_VER_MAJOR 1
19+
#define ESP_LCD_PANEL_IO_ADDITIONS_VER_MINOR 0
20+
#define ESP_LCD_PANEL_IO_ADDITIONS_VER_PATCH 0
21+
22+
1823
#define LCD_CMD_BYTES_MAX (sizeof(uint32_t)) // Maximum number of bytes for LCD command
1924
#define LCD_PARAM_BYTES_MAX (sizeof(uint32_t)) // Maximum number of bytes for LCD parameter
2025

@@ -70,10 +75,8 @@ esp_err_t esp_lcd_new_panel_io_3wire_spi(const esp_lcd_panel_io_3wire_spi_config
7075
{
7176
ESP_RETURN_ON_FALSE(io_config && ret_io, ESP_ERR_INVALID_ARG, TAG, "Invalid argument");
7277
ESP_RETURN_ON_FALSE(io_config->expect_clk_speed <= PANEL_IO_3WIRE_SPI_CLK_MAX, ESP_ERR_INVALID_ARG, TAG, "Invalid Clock frequency");
73-
ESP_RETURN_ON_FALSE(io_config->lcd_cmd_bytes > 0 && io_config->lcd_cmd_bytes <= LCD_CMD_BYTES_MAX, ESP_ERR_INVALID_ARG,
74-
TAG, "Invalid LCD command bytes");
75-
ESP_RETURN_ON_FALSE(io_config->lcd_param_bytes > 0 && io_config->lcd_param_bytes <= LCD_PARAM_BYTES_MAX, ESP_ERR_INVALID_ARG,
76-
TAG, "Invalid LCD parameter bytes");
78+
ESP_RETURN_ON_FALSE(io_config->lcd_cmd_bytes > 0 && io_config->lcd_cmd_bytes <= LCD_CMD_BYTES_MAX, ESP_ERR_INVALID_ARG, TAG, "Invalid LCD command bytes");
79+
ESP_RETURN_ON_FALSE(io_config->lcd_param_bytes > 0 && io_config->lcd_param_bytes <= LCD_PARAM_BYTES_MAX, ESP_ERR_INVALID_ARG, TAG, "Invalid LCD parameter bytes");
7780

7881
const spi_line_config_t *line_config = &io_config->line_config;
7982

@@ -136,8 +139,7 @@ esp_err_t esp_lcd_new_panel_io_3wire_spi(const esp_lcd_panel_io_3wire_spi_config
136139
ESP_GOTO_ON_ERROR(gpio_set_level(panel_io->sda_io_num, sda_scl_idle_level), err, TAG, "Set SDA level failed");
137140

138141
*ret_io = (esp_lcd_panel_io_handle_t)panel_io;
139-
ESP_LOGI(TAG, "Panel IO create success, version: %d.%d.%d", ESP_LCD_PANEL_IO_ADDITIONS_VER_MAJOR,
140-
ESP_LCD_PANEL_IO_ADDITIONS_VER_MINOR, ESP_LCD_PANEL_IO_ADDITIONS_VER_PATCH);
142+
ESP_LOGI(TAG, "Panel IO create success, version: %d.%d.%d", ESP_LCD_PANEL_IO_ADDITIONS_VER_MAJOR, ESP_LCD_PANEL_IO_ADDITIONS_VER_MINOR, ESP_LCD_PANEL_IO_ADDITIONS_VER_PATCH);
141143
return ESP_OK;
142144

143145
err:

ext_mod/spi3wire/src/spi3wire.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static mp_obj_t spi3wire_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t
127127

128128
esp_err_t ret = esp_lcd_new_panel_io_3wire_spi(self->io_config, &self->panel_io_handle);
129129

130-
if (ret !- 0) {
130+
if (ret != 0) {
131131
mp_raise_msg_varg(&mp_type_OSError, MP_ERROR_TEXT("%d(esp_lcd_new_panel_io_3wire_spi)"), ret);
132132
}
133133

@@ -161,13 +161,13 @@ static mp_obj_t spi3wire_tx_param(size_t n_args, const mp_obj_t *pos_args, mp_ma
161161
size_t buf_len = 0;
162162

163163
if (args[ARG_params].u_obj != mp_const_none) {
164-
mp_buffer_info_t *bufinfo;
164+
mp_buffer_info_t bufinfo;
165165
mp_get_buffer_raise(args[ARG_params].u_obj, &bufinfo, MP_BUFFER_READ);
166166
buf_len = bufinfo.len;
167167
buf = bufinfo.buf;
168168
}
169169

170-
LCD_DEBUG_PRINT("spi3wire_tx_param(self, lcd_cmd=%d, param, param_size=%d)\n", cmd, buf_len)
170+
SPI3WIRE_DEBUG_PRINT("spi3wire_tx_param(self, lcd_cmd=%d, param, param_size=%d)\n", cmd, buf_len)
171171

172172
esp_err_t ret = esp_lcd_panel_io_tx_param(self->panel_io_handle, cmd, buf, buf_len);
173173

@@ -185,7 +185,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(spi3wire_tx_param_obj, 2, spi3wire_tx_param);
185185

186186
mp_obj_t spi3wire_deinit(mp_obj_t obj)
187187
{
188-
LCD_DEBUG_PRINT("spi3wire_deinit(self)\n")
188+
SPI3WIRE_DEBUG_PRINT("spi3wire_deinit(self)\n")
189189

190190
mp_spi3wire_obj_t *self = (mp_spi3wire_obj_t *)obj;
191191

@@ -213,13 +213,13 @@ mp_obj_t spi3wire_deinit(mp_obj_t obj)
213213
spi3wire_objs = m_realloc(spi3wire_objs, spi3wire_count * sizeof(mp_spi3wire_obj_t *));
214214
}
215215

216-
return mp_const_none
216+
return mp_const_none;
217217
}
218218

219219
static MP_DEFINE_CONST_FUN_OBJ_1(spi3wire_deinit_obj, spi3wire_deinit);
220220

221221

222-
static const mp_rom_map_elem_t mp_spi3wire_locals_dict_table[] = {
222+
static const mp_rom_map_elem_t spi3wire_locals_dict_table[] = {
223223
{ MP_ROM_QSTR(MP_QSTR_tx_param), MP_ROM_PTR(&spi3wire_tx_param_obj) },
224224
{ MP_ROM_QSTR(MP_QSTR_init), MP_ROM_PTR(&spi3wire_init_obj) },
225225
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&spi3wire_deinit_obj) },
@@ -238,17 +238,17 @@ MP_DEFINE_CONST_OBJ_TYPE(
238238
);
239239

240240

241-
static const mp_rom_map_elem_t mp_module_spi3wire_globals_table[] = {
241+
static const mp_rom_map_elem_t spi3wire_globals_table[] = {
242242
{ MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_spi3wire) },
243243
{ MP_ROM_QSTR(MP_QSTR_Spi3Wire), MP_ROM_PTR(&mp_spi3wire_type) },
244244
};
245245

246-
static MP_DEFINE_CONST_DICT(mp_module_spi3wire_globals, mp_module_spi3wire_globals_table);
246+
static MP_DEFINE_CONST_DICT(spi3wire_globals, spi3wire_globals_table);
247247

248248

249-
const mp_obj_module_t mp_module_spi3wire = {
249+
const mp_obj_module_t module_spi3wire = {
250250
.base = {&mp_type_module},
251-
.globals = (mp_obj_dict_t *)&mp_module_spi3wire_globals,
251+
.globals = (mp_obj_dict_t *)&spi3wire_globals,
252252
};
253253

254-
MP_REGISTER_MODULE(MP_QSTR_spi3wire, mp_module_spi3wire);
254+
MP_REGISTER_MODULE(MP_QSTR_spi3wire, module_spi3wire);

0 commit comments

Comments
 (0)