Skip to content

Commit 9f83669

Browse files
committed
working on being able to share the SPI Bus
1 parent 0f0ee16 commit 9f83669

File tree

8 files changed

+11
-16
lines changed

8 files changed

+11
-16
lines changed

builder/esp32.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,7 @@ def build_commands(_, extra_args, script_dir, lv_cflags, ___):
351351
f'LV_CFLAGS="{lv_cflags}"',
352352
f'LV_PORT=esp32',
353353
f'BOARD={board}',
354-
'USER_C_MODULES=../../../../../ext_mod/micropython.cmake',
355-
f'"IDFPY_FLAGS=-DMICROPY_CPP_INC_EXTRA={script_dir}/micropy_updates/common"'
354+
'USER_C_MODULES=../../../../../ext_mod/micropython.cmake'
356355
])
357356

358357
esp_cmd.extend(extra_args)

builder/macOS.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
8080
'-Wno-unused-function '
8181
'-Wno-double-promotion '
8282
'-Wno-unused-command-line-argument '
83-
'-Wno-missing-field-initializers '
84-
f'-I{script_dir}/micropy_updates/common"'
83+
'-Wno-missing-field-initializers'
8584
# 'export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"'
8685
)
8786
])

builder/nrf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
4848

4949
compile_cmd.extend(nrf_cmd[:])
5050
compile_cmd.pop(1)
51-
compile_cmd.append(f'"CFLAGS_EXTRA=-I{script_dir}/micropy_updates/common"')
5251

5352
submodules_cmd.extend(nrf_cmd[:])
5453
submodules_cmd[1] = 'submodules'

builder/renesas.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
4848

4949
compile_cmd.extend(renesas_cmd[:])
5050
compile_cmd.pop(1)
51-
compile_cmd.append(f'"CFLAGS_EXTRA=-I{script_dir}/micropy_updates/common"')
5251

5352
submodules_cmd.extend(renesas_cmd[:])
5453
submodules_cmd[1] = 'submodules'

builder/rp2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def build_commands(_, extra_args, script_path, lv_cflags, board):
7171

7272
compile_cmd.extend(rp2_cmd[:])
7373
compile_cmd.pop(1)
74-
compile_cmd.append(f'"CFLAGS_EXTRA=-I{script_path}/micropy_updates/common"')
7574

7675
submodules_cmd.extend(rp2_cmd[:])
7776
submodules_cmd[1] = 'submodules'

builder/stm32.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
4949

5050
compile_cmd.extend(stm32_cmd[:])
5151
compile_cmd.pop(1)
52-
compile_cmd.append(f'"CFLAGS_EXTRA=-I{script_dir}/micropy_updates/common"')
5352

5453
submodules_cmd.extend(stm32_cmd[:])
5554
submodules_cmd[1] = 'submodules'

builder/unix.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def build_commands(_, extra_args, script_dir, lv_cflags, board):
7171
unix_cmd.extend([
7272
f'LV_CFLAGS="{lv_cflags}"',
7373
f'LV_PORT=unix',
74-
f'USER_C_MODULES="{script_dir}/ext_mod"',
75-
f'"CFLAGS_EXTRA=-Wno-missing-field-initializers -I{script_dir}/micropy_updates/common"'
74+
f'USER_C_MODULES="{script_dir}/ext_mod"'
7675
])
7776

7877
unix_cmd.extend(extra_args)

micropy_updates/stm32/machine_spi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,16 @@ mp_obj_t machine_hard_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz
167167
// set the SPI configuration values
168168

169169
spi_t *spi = (spi_t *)self->spi_bus->user_data;
170-
spi->spi->Init->Mode = SPI_MODE_MASTER;
170+
SPI_InitTypeDef *init = spi->spi->Init;
171+
172+
init->Mode = SPI_MODE_MASTER;
171173

172174
// these parameters are not currently configurable
173-
spi->spi->Init->Direction = SPI_DIRECTION_2LINES;
174-
spi->spi->Init->NSS = SPI_NSS_SOFT;
175-
spi->spi->Init->TIMode = SPI_TIMODE_DISABLE;
176-
spi->spi->Init->CRCCalculation = SPI_CRCCALCULATION_DISABLE;
177-
spi->spi->Init->CRCPolynomial = 0;
175+
init->Direction = SPI_DIRECTION_2LINES;
176+
init->NSS = SPI_NSS_SOFT;
177+
init->TIMode = SPI_TIMODE_DISABLE;
178+
init->CRCCalculation = SPI_CRCCALCULATION_DISABLE;
179+
init->CRCPolynomial = 0;
178180

179181
self->polarity = (uint8_t)args[ARG_polarity].u_int;
180182
self->phase = (uint8_t)args[ARG_phase].u_int;

0 commit comments

Comments
 (0)